<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2">
<meta name="theme-color" content="#222">
<meta name="generator" content="Hexo 5.2.0">
  <link rel="apple-touch-icon" sizes="180x180" href="/blog/images/apple-touch-icon-next.png">
  <link rel="icon" type="image/png" sizes="32x32" href="/blog/images/favicon-32x32-next.png">
  <link rel="icon" type="image/png" sizes="16x16" href="/blog/images/favicon-16x16-next.png">
  <link rel="mask-icon" href="/blog/images/logo.svg" color="#222">

<link rel="stylesheet" href="/blog/css/main.css">


<link rel="stylesheet" href="/blog/lib/font-awesome/css/all.min.css">

<script id="hexo-configurations">
    var NexT = window.NexT || {};
    var CONFIG = {"hostname":"ios103.gitee.io","root":"/blog/","scheme":"Gemini","version":"7.8.0","exturl":false,"sidebar":{"position":"left","display":"post","padding":18,"offset":12,"onmobile":false},"copycode":{"enable":false,"show_result":false,"style":null},"back2top":{"enable":true,"sidebar":false,"scrollpercent":false},"bookmark":{"enable":false,"color":"#222","save":"auto"},"fancybox":false,"mediumzoom":false,"lazyload":false,"pangu":false,"comments":{"style":"tabs","active":null,"storage":true,"lazyload":false,"nav":null},"algolia":{"hits":{"per_page":10},"labels":{"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}},"localsearch":{"enable":false,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false},"motion":{"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}}};
  </script>

  <meta property="og:type" content="website">
<meta property="og:title" content="小龙人的妙妙屋">
<meta property="og:url" content="https://ios103.gitee.io/index.html">
<meta property="og:site_name" content="小龙人的妙妙屋">
<meta property="og:locale" content="zh_CN">
<meta property="article:author" content="小龙人">
<meta name="twitter:card" content="summary">

<link rel="canonical" href="https://ios103.gitee.io/">


<script id="page-configurations">
  // https://hexo.io/docs/variables.html
  CONFIG.page = {
    sidebar: "",
    isHome : true,
    isPost : false,
    lang   : 'zh-CN'
  };
</script>

  <title>小龙人的妙妙屋</title>
  






  <noscript>
  <style>
  .use-motion .brand,
  .use-motion .menu-item,
  .sidebar-inner,
  .use-motion .post-block,
  .use-motion .pagination,
  .use-motion .comments,
  .use-motion .post-header,
  .use-motion .post-body,
  .use-motion .collection-header { opacity: initial; }

  .use-motion .site-title,
  .use-motion .site-subtitle {
    opacity: initial;
    top: initial;
  }

  .use-motion .logo-line-before i { left: initial; }
  .use-motion .logo-line-after i { right: initial; }
  </style>
</noscript>

</head>

<body itemscope itemtype="http://schema.org/WebPage">
  <div class="container use-motion">
    <div class="headband"></div>

    <header class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-container">
  <div class="site-nav-toggle">
    <div class="toggle" aria-label="切换导航栏">
      <span class="toggle-line toggle-line-first"></span>
      <span class="toggle-line toggle-line-middle"></span>
      <span class="toggle-line toggle-line-last"></span>
    </div>
  </div>

  <div class="site-meta">

    <a href="/blog/" class="brand" rel="start">
      <span class="logo-line-before"><i></i></span>
      <h1 class="site-title">小龙人的妙妙屋</h1>
      <span class="logo-line-after"><i></i></span>
    </a>
  </div>

  <div class="site-nav-right">
    <div class="toggle popup-trigger">
    </div>
  </div>
</div>




<nav class="site-nav">
  <ul id="menu" class="main-menu menu">
        <li class="menu-item menu-item-home">

    <a href="/blog/" rel="section"><i class="fa fa-home fa-fw"></i>首页</a>

  </li>
        <li class="menu-item menu-item-categories">

    <a href="/blog/categories/" rel="section"><i class="fa fa-th fa-fw"></i>分类</a>

  </li>
        <li class="menu-item menu-item-archives">

    <a href="/blog/archives/" rel="section"><i class="fa fa-archive fa-fw"></i>归档</a>

  </li>
  </ul>
</nav>




</div>
    </header>

    
  <div class="back-to-top">
    <i class="fa fa-arrow-up"></i>
    <span>0%</span>
  </div>


    <main class="main">
      <div class="main-inner">
        <div class="content-wrap">
          

          <div class="content index posts-expand">
            
      
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="https://ios103.gitee.io/2020/10/12/%E5%A6%82%E4%BD%95%E5%B0%86Raspbian-Lite%E5%8D%87%E7%BA%A7%E5%88%B0%E6%A1%8C%E9%9D%A2%EF%BC%88PIXEL%EF%BC%8CKDE%EF%BC%8CMATE%E7%AD%89%EF%BC%89/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/blog/images/avatar.gif">
      <meta itemprop="name" content="小龙人">
      <meta itemprop="description" content="">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="小龙人的妙妙屋">
    </span>
      <header class="post-header">
        <h2 class="post-title" itemprop="name headline">
          
            <a href="/blog/2020/10/12/%E5%A6%82%E4%BD%95%E5%B0%86Raspbian-Lite%E5%8D%87%E7%BA%A7%E5%88%B0%E6%A1%8C%E9%9D%A2%EF%BC%88PIXEL%EF%BC%8CKDE%EF%BC%8CMATE%E7%AD%89%EF%BC%89/" class="post-title-link" itemprop="url">如何将Raspbian Lite升级到桌面（PIXEL，KDE，MATE等）</a>
        </h2>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-calendar"></i>
              </span>
              <span class="post-meta-item-text">发表于</span>
              

              <time title="创建时间：2020-10-12 19:00:09 / 修改时间：19:00:49" itemprop="dateCreated datePublished" datetime="2020-10-12T19:00:09+08:00">2020-10-12</time>
            </span>
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-folder"></i>
              </span>
              <span class="post-meta-item-text">分类于</span>
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/blog/categories/%E6%A0%91%E8%8E%93%E6%B4%BE/" itemprop="url" rel="index"><span itemprop="name">树莓派</span></a>
                </span>
            </span>

          

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
          <h1 id="如何将Raspbian-Lite升级到桌面（PIXEL，KDE，MATE等）"><a href="#如何将Raspbian-Lite升级到桌面（PIXEL，KDE，MATE等）" class="headerlink" title="如何将Raspbian Lite升级到桌面（PIXEL，KDE，MATE等）"></a>如何将Raspbian Lite升级到桌面（PIXEL，KDE，MATE等）</h1><h3 id="更新系统"><a href="#更新系统" class="headerlink" title="更新系统"></a>更新系统</h3><figure class="highlight sh"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line">sudo apt update</span><br><span class="line"></span><br><span class="line">sudo apt upgrade</span><br><span class="line"></span><br><span class="line">sudo apt dist-upgrade</span><br><span class="line"></span><br><span class="line">sudo reboot</span><br></pre></td></tr></table></figure>

<h3 id="Xorg"><a href="#Xorg" class="headerlink" title="Xorg"></a>Xorg</h3><p>Xorg是Linux系统上的显示服务器<br>也就是说，它是任何桌面环境的核心组件<br>因此，无论您做出什么选择，都需要先安装</p>
<figure class="highlight sh"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">sudo apt install xserver-xorg</span><br><span class="line"></span><br></pre></td></tr></table></figure>

<h3 id="桌面环境安装"><a href="#桌面环境安装" class="headerlink" title="桌面环境安装"></a>桌面环境安装</h3><h3 id="要安装PIXEL-Desktop"><a href="#要安装PIXEL-Desktop" class="headerlink" title="要安装PIXEL Desktop"></a>要安装PIXEL Desktop</h3><figure class="highlight sh"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">sudo apt install raspberrypi-ui-mods</span><br></pre></td></tr></table></figure>

<h3 id="要安装KDE"><a href="#要安装KDE" class="headerlink" title="要安装KDE"></a>要安装KDE</h3><figure class="highlight sh"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">sudo apt install kde-plasma-desktop</span><br></pre></td></tr></table></figure>

<h3 id="对于LXDE"><a href="#对于LXDE" class="headerlink" title="对于LXDE"></a>对于LXDE</h3><figure class="highlight sh"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">sudo apt install lxde-core lxappearance</span><br></pre></td></tr></table></figure>

<h3 id="要安装XFCE"><a href="#要安装XFCE" class="headerlink" title="要安装XFCE"></a>要安装XFCE</h3><figure class="highlight sh"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">sudo apt install xfce4 xfce4-terminal</span><br></pre></td></tr></table></figure>

<h3 id="MATE桌面安装"><a href="#MATE桌面安装" class="headerlink" title="MATE桌面安装"></a>MATE桌面安装</h3><figure class="highlight sh"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">sudo apt install mate-desktop-environment-core</span><br></pre></td></tr></table></figure>

<h3 id="LightDM"><a href="#LightDM" class="headerlink" title="LightDM"></a>LightDM</h3><p>LightDM是显示管理器<br>必须使用此软件包才能在启动时自动启动桌面环境并管理登录部分<br>它是一切所需之间的链接（Raspbian，Xorg和您的桌面环境）</p>
<figure class="highlight sh"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">sudo apt install lightdm</span><br><span class="line"></span><br><span class="line">sudo reboot</span><br></pre></td></tr></table></figure>

<h3 id="安装更多应用"><a href="#安装更多应用" class="headerlink" title="安装更多应用"></a>安装更多应用</h3><p><strong>Synaptic</strong></p>
<p><strong>Synaptic是程序包管理器。</strong></p>
<figure class="highlight sh"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">sudo apt install synaptic</span><br></pre></td></tr></table></figure>

<p><strong>Chromium</strong></p>
<figure class="highlight sh"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">sudo apt install chromium-browser</span><br></pre></td></tr></table></figure>

<p>结尾！</p>

      
    </div>

    
    
    
      <footer class="post-footer">
        <div class="post-eof"></div>
      </footer>
  </article>
  
  
  

      
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="https://ios103.gitee.io/2020/10/12/Linux%EF%BC%88CentOS7%EF%BC%89%E5%B8%B8%E7%94%A8%E5%91%BD%E4%BB%A4%E8%AF%A6%E8%A7%A3/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/blog/images/avatar.gif">
      <meta itemprop="name" content="小龙人">
      <meta itemprop="description" content="">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="小龙人的妙妙屋">
    </span>
      <header class="post-header">
        <h2 class="post-title" itemprop="name headline">
          
            <a href="/blog/2020/10/12/Linux%EF%BC%88CentOS7%EF%BC%89%E5%B8%B8%E7%94%A8%E5%91%BD%E4%BB%A4%E8%AF%A6%E8%A7%A3/" class="post-title-link" itemprop="url">Linux（CentOS7）常用命令详解</a>
        </h2>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-calendar"></i>
              </span>
              <span class="post-meta-item-text">发表于</span>
              

              <time title="创建时间：2020-10-12 16:25:51 / 修改时间：18:12:01" itemprop="dateCreated datePublished" datetime="2020-10-12T16:25:51+08:00">2020-10-12</time>
            </span>
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-folder"></i>
              </span>
              <span class="post-meta-item-text">分类于</span>
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/blog/categories/Linux/" itemprop="url" rel="index"><span itemprop="name">Linux</span></a>
                </span>
            </span>

          

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
          <p><a target="_blank" rel="noopener" href="https://www.cnblogs.com/yangfei123/p/12758414.html">Linux（CentOS7）常用命令详解</a></p>
<h5 id="一、Linux的树型目录结构"><a href="#一、Linux的树型目录结构" class="headerlink" title="一、Linux的树型目录结构"></a>一、Linux的树型目录结构</h5><blockquote>
<p>在详解常用命令之前，先对Linux的树型目录结构做个简单的了解，如下所示：</p>
</blockquote>
<p>简单说明：</p>
<figure class="highlight sh"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br></pre></td><td class="code"><pre><span class="line">/      <span class="comment">#根目录</span></span><br><span class="line">/bin   <span class="comment">#基础系统所需要的命令位于此目录，是最小系统所需要的命令，如：ls， cp， cd等等。这个目录中的文件都是可执行的，一般的用户都可以使用。</span></span><br><span class="line">/dev   <span class="comment">#设备文件，比如声卡、磁盘、鼠标、键盘等。</span></span><br><span class="line">/etc  <span class="comment">#系统管理和配置文件</span></span><br><span class="line">/etc/init.d   <span class="comment">#启动配置文件和脚本,可在这里添加启动脚本。</span></span><br><span class="line">/etc/rc.local   <span class="comment">#用户添加启动项</span></span><br><span class="line">/home  <span class="comment">#用户主目录，比如用户user的主目录就是/home/user，可以用~user表示</span></span><br><span class="line">/lib   <span class="comment">#标准程序设计库存放路径，又叫动态链接共享库，作用类似windows里的.dll文件</span></span><br><span class="line">/sbin  <span class="comment">#超级管理命令，这里存放的是系统管理员使用的管理程序。</span></span><br><span class="line">/tmp   <span class="comment">#临时文件目录，有时用户运行程序的时候，会产生临时文件。 /tmp就用来存放临时文件的。</span></span><br><span class="line">/root  <span class="comment">#系统管理员的主目录</span></span><br><span class="line">/mnt   <span class="comment">#用来临时挂载其他的文件系统</span></span><br><span class="line">/lost+found   <span class="comment">#这个目录平时是空的，系统意外崩溃或机器意外关机，而产生一些文件碎片放在这里。当系统启动的过程中fsck工具会检查这里，并修复已经损坏的文件系统。</span></span><br><span class="line">/media      <span class="comment">#即插即用型存储设备的挂载点自动在这个目录下创建，比如USB盘系统自动挂载后，会在这个目录下产生一个目录 </span></span><br><span class="line">/proc  <span class="comment">#虚拟文件目录，可直接访问这个目录来获取系统信息。</span></span><br><span class="line">/var   <span class="comment">#所有服务的登录文件或错误讯息档案（log files）都在 /var/log 里面</span></span><br><span class="line">/boot  <span class="comment">#包含Linux内核及系统引导程序所需要的文件，比如 vmlinuz initrd.img 文件都位于这个目录中。在一 般情况下，GRUB或LILO系统引导管理器也位于这个目录；</span></span><br><span class="line">/usr   <span class="comment">#最庞大的目录，要用到的应用程序和文件几乎都在这个目录，其中包含：</span></span><br><span class="line">  usr/bin     <span class="comment">#众多的应用程序</span></span><br><span class="line">  /usr/sbin     <span class="comment">#超级用户的一些管理程序</span></span><br><span class="line">  /usr/include  <span class="comment">#Linux下开发和编译应用程序所需要的头文件</span></span><br><span class="line">  /usr/lib     <span class="comment">#常用的动态链接库</span></span><br><span class="line">  /usr/share/man  <span class="comment">#帮助文档</span></span><br><span class="line">  /usr/src     <span class="comment">#源代码，Linux内核的源代码就放在/usr/src/Linux里</span></span><br><span class="line">  /usr/<span class="built_in">local</span>/bin  <span class="comment">#本地增加的命令</span></span><br><span class="line">  /usr/<span class="built_in">local</span>/lib  <span class="comment">#本地增加的库根文件系统</span></span><br><span class="line">. ：代表当前路径</span><br><span class="line"></span><br><span class="line">.. ：代表上一级目录</span><br><span class="line"></span><br><span class="line">~ ：代表用户目录路径</span><br></pre></td></tr></table></figure>



<h5 id="二、常用命令详解"><a href="#二、常用命令详解" class="headerlink" title="二、常用命令详解"></a>二、常用命令详解</h5><h6 id="2-1-ls-命令"><a href="#2-1-ls-命令" class="headerlink" title="2.1 ls 命令"></a>2.1 ls 命令</h6><figure class="highlight sh"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">ls是英文单词list的缩写.用来查看文件目录的属性。</span><br><span class="line"></span><br><span class="line">例如直接输入ls按回车，查看根目录的文件以及目录。</span><br></pre></td></tr></table></figure>

<h6 id="2-1-1-ls-l命令"><a href="#2-1-1-ls-l命令" class="headerlink" title="2.1.1 ls -l命令"></a>2.1.1 ls -l命令</h6><figure class="highlight sh"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br></pre></td><td class="code"><pre><span class="line">ls -­l  l参数代表以列表的方式显示。</span><br><span class="line"></span><br><span class="line">  <span class="comment">#第一个字符d 代表这是一个目录文件。</span></span><br><span class="line">  <span class="comment"># ‐  代表普通文件</span></span><br><span class="line">  <span class="comment"># c  字符设备文件</span></span><br><span class="line">  <span class="comment"># b  块设备文件</span></span><br><span class="line">  <span class="comment"># p  管道文件</span></span><br><span class="line">  <span class="comment"># l  链接文件</span></span><br><span class="line">  <span class="comment"># s  socket文件</span></span><br><span class="line"><span class="comment">#后面的rwxr‐xr‐x字符，代表user、group、other对文件所拥有的权限，rwx代表该用户拥有读写执行的权限。r‐x</span></span><br><span class="line">代表同一组的用户拥有的读和执行权限，后一个r‐x代表其他用户拥有读和执行权限。</span><br><span class="line"><span class="comment"># 2代表文件硬链接的计数，表示该文件有两个硬链接。</span></span><br><span class="line"><span class="comment"># where 文件所属的用户名。</span></span><br><span class="line"><span class="comment"># where  文件所属的用户组。</span></span><br><span class="line"><span class="comment"># 4096 文件大小，单位字节。</span></span><br><span class="line"><span class="comment"># 6月 25 16:53  文件最后被修改的日期。</span></span><br><span class="line"><span class="comment"># Videos 文件名</span></span><br></pre></td></tr></table></figure>



<h6 id="2-1-2-ls-a命令"><a href="#2-1-2-ls-a命令" class="headerlink" title="2.1.2 ls -a命令"></a>2.1.2 ls -a命令</h6><figure class="highlight sh"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">ls -a ­a参数代表all的意思，表示把所有的文件都罗列出来，包括隐藏文件，点号开头的在Linux中都表示隐藏文件。</span><br><span class="line"> </span><br><span class="line"></span><br><span class="line"> ls ‐ld [filename] 代表只列出目录文件的属性。</span><br></pre></td></tr></table></figure>



<h6 id="2-2-stat命令"><a href="#2-2-stat命令" class="headerlink" title="2.2 stat命令"></a>2.2 stat命令</h6><figure class="highlight sh"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">查看文件的访问时间，修改时间等</span><br><span class="line">访问时间，是指通过指令如cat、vi等来查看的文件的最近一次时间。更改时间，是指修改文件内容的最近一次时间。</span><br><span class="line">改动时间，是指修改文件属性的最近一次时间。</span><br><span class="line">注意：访问时间是内容更改后，第一次访问的时间，后面再次访问的时候访问时间不会改变</span><br></pre></td></tr></table></figure>





<h6 id="2-3-cd命令"><a href="#2-3-cd命令" class="headerlink" title="2.3 cd命令"></a>2.3 cd命令</h6><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">cd 是 change directory的缩写，表示改变当前所在路径。</span><br></pre></td></tr></table></figure>

<h6 id="2-4-pwd命令"><a href="#2-4-pwd命令" class="headerlink" title="2.4 pwd命令"></a>2.4 pwd命令</h6><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">pwd 是英文print working directory 显示当前所在路径。</span><br></pre></td></tr></table></figure>

<h6 id="2-5-which命令"><a href="#2-5-which命令" class="headerlink" title="2.5 which命令"></a>2.5 which命令</h6><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">寻找可执行文件 ，并在PATH环境变量里面寻找</span><br></pre></td></tr></table></figure>

<h6 id="2-6-touch命令"><a href="#2-6-touch命令" class="headerlink" title="2.6 touch命令"></a>2.6 touch命令</h6><figure class="highlight sh"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><span class="line">将每个文件的访问及修改时间都更新为目前的时间。</span><br><span class="line"></span><br><span class="line">如果文件不存在，则创建一个字节数为0的文件。</span><br><span class="line"></span><br><span class="line">‐a           <span class="comment">#只更新访问时间，不改变修改时间</span></span><br><span class="line">‐c           <span class="comment">#不创建不存在的文件</span></span><br><span class="line">‐m           <span class="comment">#只更新修改时间，不改变访问时间</span></span><br><span class="line">‐r file      <span class="comment">#使用文件file的时间更新文件的时间</span></span><br><span class="line">‐t           <span class="comment">#将时间修改为参数指定的日期,如：07081556代表7月8号15点56分</span></span><br></pre></td></tr></table></figure>



<h6 id="2-7-mkdir-命令"><a href="#2-7-mkdir-命令" class="headerlink" title="2.7 mkdir 命令"></a>2.7 mkdir 命令</h6><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">mkdir 是make directory的英文缩写。</span><br><span class="line">创建目录DIRECTORY，可以一次创建多个。OPTION如果是­p，表示可以连同父目录一起创建。</span><br></pre></td></tr></table></figure>



<h6 id="2-8-rmdir-命令"><a href="#2-8-rmdir-命令" class="headerlink" title="2.8 rmdir 命令"></a>2.8 rmdir 命令</h6><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">rmdir是remove directory的英文缩写。</span><br><span class="line">删除空目录，可以一次删除多个。OPTION如果是­p，表示可以连同空的父目录一起删除。但是一旦父目录中还包含其他文件，则删除失败。</span><br></pre></td></tr></table></figure>



<h6 id="2-9-rm-命令"><a href="#2-9-rm-命令" class="headerlink" title="2.9 rm 命令"></a>2.9 rm 命令</h6><figure class="highlight sh"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line">rm是remove的英文缩写。</span><br><span class="line">可以用来删除普通文件，也可以用来删除目录，特别用来删除目录中嵌套有子目录的目录文件。</span><br><span class="line">常用参数：</span><br><span class="line"></span><br><span class="line">‐f  ‐‐force  <span class="comment">#强制删除，不询问是否要删除。</span></span><br><span class="line">‐r  ‐‐recursive  <span class="comment">#递归删除，包括文件夹中的内容。</span></span><br></pre></td></tr></table></figure>





<h6 id="2-10-mv命令"><a href="#2-10-mv命令" class="headerlink" title="2.10 mv命令"></a>2.10 mv命令</h6><figure class="highlight sh"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">mv是英文单词move的缩写。可以用来移动文件夹或者文件，也可以用来更改文件名。</span><br><span class="line">mv file / <span class="comment">#把文件file移动到根目录中</span></span><br><span class="line"></span><br><span class="line">mv file file_bak <span class="comment">#把文件file重命名为file_bak。</span></span><br></pre></td></tr></table></figure>



<h6 id="2-11-cp命令"><a href="#2-11-cp命令" class="headerlink" title="2.11 cp命令"></a>2.11 cp命令</h6><figure class="highlight sh"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line">cp是英文单词copy的缩写，表示拷贝文件。</span><br><span class="line"></span><br><span class="line">可以用来拷贝普通文件：</span><br><span class="line">cp file file_bak <span class="comment">#拷贝一份file为file_bak</span></span><br><span class="line"></span><br><span class="line">可以用来拷贝目录</span><br><span class="line">cp dir dir_bak ‐r <span class="comment">#拷贝一个目录dir为dir_bak, ‐r参数代表递归拷贝，把dir目录中的文件也拷贝过去</span></span><br></pre></td></tr></table></figure>





<h6 id="2-12-cat命令"><a href="#2-12-cat命令" class="headerlink" title="2.12 cat命令"></a>2.12 cat命令</h6><figure class="highlight sh"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line">cat英文单词concatenate连锁的缩写，用来查看文件内容，以及将几个文件连成一个文件，</span><br><span class="line">不填文件参数，默认的情况下是从标准输入中获取内容： </span><br><span class="line"></span><br><span class="line">查看文件： cat fileName</span><br><span class="line"></span><br><span class="line">将文件file1 file2连成file3文件</span><br><span class="line">cat file1 file2 &gt; file3</span><br></pre></td></tr></table></figure>





<h6 id="2-13-more命令"><a href="#2-13-more命令" class="headerlink" title="2.13 more命令"></a>2.13 more命令</h6><figure class="highlight sh"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line">more 是我们最常用的工具之一，最常用的就是显示输出的内容，然后根据窗口的大小进行分页显示，并且提示文件的百分比。</span><br><span class="line">参数如下：</span><br><span class="line"></span><br><span class="line">+num    <span class="comment">#从第num行开始显示；</span></span><br><span class="line">‐num    <span class="comment">#定义每屏显示num行；</span></span><br><span class="line"></span><br><span class="line">打开之后的动作：</span><br></pre></td></tr></table></figure>





<h6 id="2-14-less命令"><a href="#2-14-less命令" class="headerlink" title="2.14 less命令"></a>2.14 less命令</h6><figure class="highlight sh"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line">less工具也是对文件或其它输出进行分页显示的工具</span><br><span class="line"></span><br><span class="line">参数如下:</span><br><span class="line"></span><br><span class="line">‐f    <span class="comment">#强制打开文件，二进制文件显示时，不提示警告；</span></span><br><span class="line">‐N    <span class="comment">#在每行前输出行号；</span></span><br><span class="line"></span><br><span class="line">打开之后的动作：</span><br></pre></td></tr></table></figure>



<h6 id="2-15-locate-命令"><a href="#2-15-locate-命令" class="headerlink" title="2.15 locate 命令"></a>2.15 locate 命令</h6><figure class="highlight sh"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">全盘寻找文件，文件名部分匹配，只要有包含该字符串的都罗列出来，这个指令查找速度很快，它需要一个数据库，这个数据库由每天的例行工作（crontab）程序来更新。当我们建立好这个数据库后，就可以方便地来搜寻</span><br><span class="line">所需文件了。</span><br><span class="line"></span><br><span class="line">马上创建的文件没办法使用locate查找到:如果想马上更新可以使用一下指令：updatedb</span><br></pre></td></tr></table></figure>



<h6 id="2-16-find-命令"><a href="#2-16-find-命令" class="headerlink" title="2.16 find 命令"></a>2.16 find 命令</h6><figure class="highlight sh"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br></pre></td><td class="code"><pre><span class="line">直接在全文件系统上搜寻，功能强大，速度慢。</span><br><span class="line"></span><br><span class="line">格式：</span><br><span class="line"></span><br><span class="line">find [path] [‐option] [ ‐<span class="built_in">print</span> ‐<span class="built_in">exec</span> ‐ok <span class="built_in">command</span> ] &#123;&#125; \;</span><br><span class="line"></span><br><span class="line">path:   <span class="comment">#要执行查找的目录。</span></span><br><span class="line">‐option: <span class="comment">#查找的具体方法。</span></span><br><span class="line">‐<span class="built_in">print</span>： <span class="comment">#find命令将匹配的文件输出到标准输出。</span></span><br><span class="line">‐<span class="built_in">exec</span>：  <span class="comment">#find命令对匹配的文件执行该参数所给出的shell命令。相应命令的形式为&#x27;command&#x27; &#123;&#125; \;，注意&#123;&#125;和</span></span><br><span class="line">\；之间的空格。</span><br><span class="line">‐ok：    <span class="comment">#和‐exec的作用相同，只不过以一种更为安全的模式来执行该参数所给出的shell命令，在执行每一个命令</span></span><br><span class="line">之前，都会给出提示，让用户来确定是否执行。</span><br><span class="line"></span><br><span class="line">find / ‐name filename   <span class="comment">#在根目录里面搜索文件名为filename的文件</span></span><br><span class="line">find /etc ‐name *s*     <span class="comment">#在目录里面搜索带有s的文件</span></span><br><span class="line">find /etc ‐name *S      <span class="comment">#在目录里面搜索以s结尾的文件</span></span><br><span class="line">find /etc ‐name s*      <span class="comment">#在目录里面搜索以s开头的文件</span></span><br><span class="line">find / ‐amin ‐10        <span class="comment">#在系统中搜索最后１０分钟访问的文件</span></span><br><span class="line">find / ‐atime ‐2        <span class="comment">#查找在系统中最后４８小时访问的文件</span></span><br><span class="line">find / ‐mmin ‐5         <span class="comment">#查找在系统中最后５分钟修改过的文件</span></span><br><span class="line">find / ‐mtime ‐1        <span class="comment">#查找在系统中最后２４小时修改过的文件</span></span><br><span class="line">find / ‐ctime ‐1        <span class="comment">#查找在系统中最后２４小时被改变状态的文件</span></span><br><span class="line">find / ‐user username   <span class="comment">#查找在系统中属于用户username的文件</span></span><br><span class="line">find / ‐group groupname  <span class="comment">#groupname 查找在系统中属于groupname的文件</span></span><br><span class="line">find / ‐empty           <span class="comment">#查找在系统中为空的文件或者是文件夹</span></span><br><span class="line">find / ‐inum 3          <span class="comment">#查找inode号为3的文件</span></span><br><span class="line">find / ‐<span class="built_in">type</span> d          <span class="comment">#查找为文件类型为文件夹的文件d为文件夹</span></span><br><span class="line">                                f     <span class="comment">#普通文件</span></span><br><span class="line">                                d     <span class="comment">#目录文件</span></span><br><span class="line">                                l     <span class="comment">#链接文件</span></span><br><span class="line">                                b     <span class="comment">#块设备文件</span></span><br><span class="line">                                c     <span class="comment">#字符设备文件</span></span><br><span class="line">                                p     <span class="comment">#管道文件</span></span><br><span class="line">                                s     <span class="comment">#socket文件</span></span><br></pre></td></tr></table></figure>



<h6 id="2-17-grep-命令"><a href="#2-17-grep-命令" class="headerlink" title="2.17 grep 命令"></a>2.17 grep 命令</h6><figure class="highlight sh"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line">搜索内容中是否包含指定的字符串，并打印出该行。</span><br><span class="line"></span><br><span class="line">常用参数有：</span><br><span class="line"></span><br><span class="line">‐i    ‐‐ignore‐<span class="keyword">case</span>   <span class="comment">#忽略字符大小写的差别。</span></span><br><span class="line">    ‐v                    <span class="comment">#输出没有指定字符串的文件</span></span><br><span class="line">    ‐c                    <span class="comment">#只输出匹配行的计数。</span></span><br><span class="line">    ‐R                    <span class="comment">#连同子目录中所有文件一起查找。</span></span><br></pre></td></tr></table></figure>



<h6 id="2-18-ln命令"><a href="#2-18-ln命令" class="headerlink" title="2.18 ln命令"></a>2.18 ln命令</h6><figure class="highlight sh"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br></pre></td><td class="code"><pre><span class="line">ln是英文单词link的缩写，用来创建链接的命令。</span><br><span class="line">   Linux链接分两种，一种被称为硬链接（Hard Link），另一种被称为符号链接（Symbolic Link）。默认情况下，ln命令产生硬链接。</span><br><span class="line">【硬链接】</span><br><span class="line">   硬链接指通过索引节点来进行链接。在Linux的文件系统中，保存在磁盘分区中的文件不管是什么类型都给它分配一个编号，称为索引节点号(Inode Index)。在Linux中，多个文件名指向同一索引节点，一般这种链接就是硬链接。</span><br><span class="line"></span><br><span class="line">   硬链接的作用是允许一个文件拥有多个有效路径名，这样用户就可以建立硬链接到重要文件，以防止“误删”。</span><br><span class="line">   如果有多个硬链接，只删除一个链接并不影响本身和其它的链接，只有当最后一个链接被删除后，文件的才会被正在删除。也就是说，文件真正删除的条件是与之相关的所有硬链接文件均被删除。</span><br><span class="line">【软链接】</span><br><span class="line">   另外一种链接称之为符号链接（Symbolic Link），也叫软链接。软链接文件有类似于Windows的快捷方式。它实际上是一个特殊的文件。符号链接文件实际上是一个文本文件，其中包含的有另一文件的位置信息。</span><br><span class="line"></span><br><span class="line">给flie文件创建一个硬链接</span><br><span class="line">touch file</span><br><span class="line">ln file file_hard</span><br><span class="line"></span><br><span class="line">给file文件创建一个软链接</span><br><span class="line">touch file</span><br><span class="line">ln ‐s file flie_soft</span><br><span class="line"></span><br><span class="line">注意: 软链接的时候尽量使用绝对路径，避免由于链接文件移动后，造成文件失效。</span><br></pre></td></tr></table></figure>



<h6 id="2-19-wc-命令"><a href="#2-19-wc-命令" class="headerlink" title="2.19 wc 命令"></a>2.19 wc 命令</h6><figure class="highlight sh"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br></pre></td><td class="code"><pre><span class="line">Linux系统中的wc为英文Word Count的缩写，命令的功能为统计指定文件中的字节数、字数、行数，并将统计结果显示输出。 </span><br><span class="line"></span><br><span class="line">命令功能：</span><br><span class="line">统计指定文件中的字节数、字数、行数，并将统计结果显示输出。如果没有给出文件名，则从标准输入读取。wc同时也给出所指定文件的总统计数。</span><br><span class="line"></span><br><span class="line">命令参数：</span><br><span class="line">‐c <span class="comment">#统计字节数。 </span></span><br><span class="line">‐l <span class="comment">#统计行数。 </span></span><br><span class="line">‐m <span class="comment">#统计字符数。这个标志不能与 ‐c 标志一起使用。 </span></span><br><span class="line">‐w <span class="comment">#统计字数。一个字被定义为由空白、跳格或换行字符分隔的字符串。 </span></span><br><span class="line">‐L <span class="comment">#打印最长行的长度。 </span></span><br></pre></td></tr></table></figure>



<h6 id="2-20-od命令"><a href="#2-20-od命令" class="headerlink" title="2.20 od命令"></a>2.20 od命令</h6><p>od是英文octal dump的缩写，功能是把文件用8进制或者其他的格式显示出来，通常用于查看特殊格式文件的内容，可以用来查看不可见字符。</p>
<h6 id="2-21-du命令"><a href="#2-21-du命令" class="headerlink" title="2.21 du命令"></a>2.21 du命令</h6><p>du是英文Disk usage的缩写，表示计算某个目录在硬盘中所占的空间大小，默认情况下以kb为单位。通过递归统计每一个目录中所占用的空间大小。</p>
<p>常用参数如下:</p>
<figure class="highlight sh"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"></span><br></pre></td></tr></table></figure>


<h6 id="2-22-df命令"><a href="#2-22-df命令" class="headerlink" title="2.22 df命令"></a>2.22 df命令</h6><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">df是英文Disk free的缩写，用来统计磁盘是使用情况。</span><br></pre></td></tr></table></figure>

<h6 id="2-23-gedit命令"><a href="#2-23-gedit命令" class="headerlink" title="2.23 gedit命令"></a>2.23 gedit命令</h6><figure class="highlight sh"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">gedit全称 GNU edit 是一个文本编辑器，类似windows里面的txt文本编辑器。编辑file文本。</span><br></pre></td></tr></table></figure>

<h6 id="2-24-管道命令"><a href="#2-24-管道命令" class="headerlink" title="2.24 管道命令"></a>2.24 管道命令</h6><figure class="highlight sh"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">用法: <span class="built_in">command</span> 1 | <span class="built_in">command</span> 2 他的功能是把第一个命令<span class="built_in">command</span> 1执行的结果作为<span class="built_in">command</span> 2的输入。管道命令操作符是：”|”它只能处理经由前面一个指令传出的正确输出信息，对错误信息信息没有直接处理能力.</span><br></pre></td></tr></table></figure>

<h6 id="2-25-重定向"><a href="#2-25-重定向" class="headerlink" title="2.25 重定向"></a>2.25 重定向</h6><figure class="highlight sh"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><span class="line">在shell中，标准输入是0，标准输出是1，标准错误是2.</span><br><span class="line">使用&gt;表示重定向。1&gt;表示标准输出重定向，2&gt;表示标准错误重定向。默认情况下&gt;表示输出重定向。</span><br><span class="line"></span><br><span class="line">例如：</span><br><span class="line"></span><br><span class="line">ls &gt; list.txt   <span class="comment">#ls的输出重定向到文件list.txt中。                     </span></span><br><span class="line">find / ‐name <span class="string">&quot;*.c&quot;</span> 2&gt;/dev/null  <span class="comment">#标准错误重定向到无底洞文件。     </span></span><br><span class="line">find / ‐name <span class="string">&quot;*.c&quot;</span> 2&gt;/dev/null  <span class="comment">#标准错误重定向到无底洞文件。     </span></span><br><span class="line">find / ‐name <span class="string">&quot;*.c&quot;</span> &gt;/dev/null 2&gt;&amp;1  <span class="comment">#标准输出、标准错误重定向到无底洞文件。</span></span><br></pre></td></tr></table></figure>



<h6 id="2-26-后台运行"><a href="#2-26-后台运行" class="headerlink" title="2.26 后台运行"></a>2.26 后台运行</h6><figure class="highlight sh"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">Linux中可以使用&amp;，让程序在后台运行。如：cat &amp;</span><br></pre></td></tr></table></figure>

<h6 id="2-27-awk命令"><a href="#2-27-awk命令" class="headerlink" title="2.27 awk命令"></a>2.27 awk命令</h6><figure class="highlight sh"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br></pre></td><td class="code"><pre><span class="line">awk就是把文件逐行的读入，以空格为默认分隔符将每行切片，切开的部分再进行各种分析处理。</span><br><span class="line"></span><br><span class="line">格式：awk [‐F field‐separator] <span class="string">&#x27;commands&#x27;</span> [input‐file(s)]</span><br><span class="line"></span><br><span class="line">其中，commands 是真正awk命令，[­F 域分隔符]是可选的。 input­file(s) 是待处理的文件。</span><br><span class="line"><span class="built_in">print</span> 是awk打印指定内容的主要命令, <span class="variable">$1</span> 分割出来的第一段，<span class="variable">$2</span>分割出来的第二段，依次类推，<span class="variable">$0</span>代表所有</span><br><span class="line">字段例如：</span><br><span class="line"></span><br><span class="line">ls ‐l | awk <span class="string">&#x27;&#123;print $1 &quot;\t&quot; $2 &quot;\t&quot; $3 &quot;\t&quot; $4&#125;&#x27;</span></span><br><span class="line"></span><br><span class="line">将/proc/meminfo文件中的字段提取出来，并且在每个字段前面添加meminfo:</span><br><span class="line"></span><br><span class="line">awk ‐F <span class="string">&#x27;:&#x27;</span> <span class="string">&#x27;&#123;print &quot;meminfo:&quot; $1&#125;&#x27;</span> /proc/meminfo</span><br></pre></td></tr></table></figure>




<p>原文链接：<a target="_blank" rel="noopener" href="https://blog.csdn.net/weixin_39951988/java/article/details/87613816">https://blog.csdn.net/weixin_39951988/java/article/details/87613816</a></p>

      
    </div>

    
    
    
      <footer class="post-footer">
        <div class="post-eof"></div>
      </footer>
  </article>
  
  
  

      
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="https://ios103.gitee.io/2020/10/12/%E6%A0%91%E8%8E%93%E6%B4%BE3B%E6%89%8B%E5%8A%A8%E5%AE%89%E8%A3%85java8/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/blog/images/avatar.gif">
      <meta itemprop="name" content="小龙人">
      <meta itemprop="description" content="">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="小龙人的妙妙屋">
    </span>
      <header class="post-header">
        <h2 class="post-title" itemprop="name headline">
          
            <a href="/blog/2020/10/12/%E6%A0%91%E8%8E%93%E6%B4%BE3B%E6%89%8B%E5%8A%A8%E5%AE%89%E8%A3%85java8/" class="post-title-link" itemprop="url">树莓派3B手动安装java8</a>
        </h2>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-calendar"></i>
              </span>
              <span class="post-meta-item-text">发表于</span>
              

              <time title="创建时间：2020-10-12 16:24:14 / 修改时间：17:41:56" itemprop="dateCreated datePublished" datetime="2020-10-12T16:24:14+08:00">2020-10-12</time>
            </span>
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-folder"></i>
              </span>
              <span class="post-meta-item-text">分类于</span>
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/blog/categories/%E6%A0%91%E8%8E%93%E6%B4%BE/" itemprop="url" rel="index"><span itemprop="name">树莓派</span></a>
                </span>
            </span>

          

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
          <p>** 树莓派3B手动安装java8**</p>
<h4 id="1、官网下载地址"><a href="#1、官网下载地址" class="headerlink" title="1、官网下载地址"></a>1、官网下载地址</h4><p><a target="_blank" rel="noopener" href="https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html">https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html</a></p>
<h4 id="2、安装过程"><a href="#2、安装过程" class="headerlink" title="2、安装过程"></a>2、安装过程</h4><p><strong>提前声明：</strong><br>因为使用的是树莓派3B,性能参数是<strong>Quad Core 1.2GHz Broadcom BCM2837 64bit CPU</strong>，所以我先下载64位，结果安装失败。<br><img src="https://img-blog.csdnimg.cn/20181203151335466.png" alt="在这里插入图片描述"><br>随后改为下载32位，结果OK，不知道为什么，但结果是好的。<br><img src="https://img-blog.csdnimg.cn/20181203151506619.png" alt="在这里插入图片描述"></p>
<ul>
<li>首先，将32位的安装包下载到本地；</li>
<li>登陆树莓派，将安装包拷贝到树莓派，使用下面命令；</li>
</ul>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$scp jdk-8u191-linux-arm32-vfp-hflt.tar.gz  pi@192.168.3.81:&#x2F;home&#x2F;pi&#x2F;    </span><br></pre></td></tr></table></figure>

<p>//复制文件，从本地到远程服务器</p>
<ul>
<li>解压</li>
</ul>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$sudo tar -zxvf ****你的文件</span><br></pre></td></tr></table></figure>

<ul>
<li>配置环境变量，打开profile文件</li>
</ul>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$sudo vim &#x2F;ect&#x2F;profile</span><br></pre></td></tr></table></figure>

<p>在里面添加</p>
<figure class="highlight sh"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line"><span class="built_in">export</span> JAVA_HOME=/usr/share/jdk1.8.0</span><br><span class="line"><span class="built_in">export</span> PATH=<span class="variable">$JAVA_HOME</span>/bin:<span class="variable">$PATH</span></span><br><span class="line"><span class="built_in">export</span> CLASSPATH=.:<span class="variable">$JAVA_HOME</span>/lib/dt.jar:<span class="variable">$JAVA_HOME</span>/lib/tools.jar</span><br><span class="line"><span class="comment">#注意要把当前目录 “.”，也添加进去</span></span><br></pre></td></tr></table></figure>

<ul>
<li>重启树莓派</li>
</ul>
<figure class="highlight sh"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="variable">$java</span> -version</span><br></pre></td></tr></table></figure>
      
    </div>

    
    
    
      <footer class="post-footer">
        <div class="post-eof"></div>
      </footer>
  </article>
  
  
  

      
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="https://ios103.gitee.io/2020/10/12/%E6%A0%91%E8%8E%93%E6%B4%BE%E5%85%A5%E9%97%A8%E5%BF%85%E4%BC%9A%E7%9A%8420%E4%B8%AALinux%E5%91%BD%E4%BB%A4/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/blog/images/avatar.gif">
      <meta itemprop="name" content="小龙人">
      <meta itemprop="description" content="">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="小龙人的妙妙屋">
    </span>
      <header class="post-header">
        <h2 class="post-title" itemprop="name headline">
          
            <a href="/blog/2020/10/12/%E6%A0%91%E8%8E%93%E6%B4%BE%E5%85%A5%E9%97%A8%E5%BF%85%E4%BC%9A%E7%9A%8420%E4%B8%AALinux%E5%91%BD%E4%BB%A4/" class="post-title-link" itemprop="url">树莓派入门必会的20个Linux命令</a>
        </h2>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-calendar"></i>
              </span>
              <span class="post-meta-item-text">发表于</span>
              

              <time title="创建时间：2020-10-12 16:22:15 / 修改时间：16:23:02" itemprop="dateCreated datePublished" datetime="2020-10-12T16:22:15+08:00">2020-10-12</time>
            </span>

          

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
          <p><img src="https://pic3.zhimg.com/v2-62ff6eb013d567e199315c23b1b8d583_1440w.jpg?source=172ae18b" alt="树莓派入门必会的20个Linux命令"></p>
<p>** 树莓派入门必会的20个Linux命令**</p>
<p><a target="_blank" rel="noopener" href="https://zhuanlan.zhihu.com/p/59012890">知乎</a></p>
<p>树莓派官方推荐的操作系统是Raspbian，这是一款免费的基于Debian Linux的操作系统，可以安装到所有版本的树莓派上。这就意味着如果不了解Linux的话，可能就无法随心所欲的捣鼓这个可人的尤物了。</p>
<p>Linux天生就是要使用CLI（command-line interface，命令行界面）操作的，因此学习树莓派就必须要会用Linux命令，本文介绍20个最常用的命令（见下表），让你能够轻松的在幽深的黑色CLI里看到色彩斑斓的世界。</p>
<p><img src="https://picb.zhimg.com/80/v2-0a08910973b05eb785957088c607737f_1440w.jpg" alt="img">树莓派入门必会的20个Linux命令</p>
<table>
<thead>
<tr>
<th>序号</th>
<th>命令</th>
<th>意义</th>
<th>列出当前目录下的文件</th>
</tr>
</thead>
<tbody><tr>
<td>1</td>
<td>ls</td>
<td>list</td>
<td>列出当前目录下的文件</td>
</tr>
<tr>
<td>2</td>
<td>pwd</td>
<td>print working directory</td>
<td>输出当前目录</td>
</tr>
<tr>
<td>3</td>
<td>cd</td>
<td>change directory</td>
<td>改变目录</td>
</tr>
<tr>
<td>4</td>
<td>mkdir</td>
<td>make directory</td>
<td>新建目录</td>
</tr>
<tr>
<td>5</td>
<td>cat</td>
<td>concatenate</td>
<td>显示或连接文件内容</td>
</tr>
<tr>
<td>6</td>
<td>rm</td>
<td>remove</td>
<td>删除文件</td>
</tr>
<tr>
<td>7</td>
<td>rmdir</td>
<td>remove directory</td>
<td>删除目录</td>
</tr>
<tr>
<td>8</td>
<td>mv</td>
<td>move</td>
<td>移动/重命名文件/目录</td>
</tr>
<tr>
<td>9</td>
<td>cp</td>
<td>copy</td>
<td>复制文件/目录</td>
</tr>
<tr>
<td>10</td>
<td>echo</td>
<td></td>
<td>显示在终端输入内容</td>
</tr>
<tr>
<td>11</td>
<td>date</td>
<td></td>
<td>读取系统日期/时间</td>
</tr>
<tr>
<td>12</td>
<td>grep</td>
<td>global search regular<br />expression and print</td>
<td>全面搜索正则表达式并打印</td>
</tr>
<tr>
<td>13</td>
<td>man</td>
<td>manual</td>
<td>显示命令使用手册</td>
</tr>
<tr>
<td>14</td>
<td>sudo</td>
<td>super user do</td>
<td>以root权限执行</td>
</tr>
<tr>
<td>15</td>
<td>chmod</td>
<td>change mode</td>
<td>改变文件读写权限</td>
</tr>
<tr>
<td>16</td>
<td>. /program</td>
<td></td>
<td>运行program</td>
</tr>
<tr>
<td>17</td>
<td>apt- get</td>
<td>Advanced Package Tool</td>
<td>安装/删除软件包</td>
</tr>
<tr>
<td>18</td>
<td>exit</td>
<td></td>
<td>退出</td>
</tr>
<tr>
<td>19</td>
<td>reboot</td>
<td></td>
<td>重新启动</td>
</tr>
<tr>
<td>10</td>
<td>shutdown</td>
<td></td>
<td>关机</td>
</tr>
</tbody></table>
<p>假设你已经完成树莓派操作系统的安装，打开系统自带的终端，显示内容如下：</p>
<p><img src="https://pic4.zhimg.com/80/v2-49dc0974fb46f7b1b1b94f777284e6bd_1440w.jpg" alt="img">树莓派Raspbian Linux终端</p>
<p>默认的命令提示符如下：</p>
<p>pi@raspberrypi:~ $</p>
<p>表明你是在名为“raspberrypi”的主机上以用户“pi”的身份登录，并且正处在“pi”用户的主目录下面。你可以在后面输入各种Linux命令，然后按回车键即可执行。</p>
<p>当然，你也可以使用超级管理员“root”用户登录，命令提示符将如下所示：</p>
<p>root@raspberrypi:~ #</p>
<p>与“pi”用户不同的是，命令提示符为#，表明这是“root”用户，树莓派默认情况下并不会启用root账户，如果想以root身份执行命令，可以参照下面的sudo命令。</p>
<h2 id="ls-列出当前目录下的文件"><a href="#ls-列出当前目录下的文件" class="headerlink" title="ls 列出当前目录下的文件"></a><strong>ls 列出当前目录下的文件</strong></h2><p><img src="https://pic3.zhimg.com/80/v2-059e2055b4b0a974f5af80987c906fa6_1440w.jpg" alt="img">ls命令</p>
<p>你可以尝试直接输入ls命令然后按回车，以及输入 ls -l命令再按回车之间有什么区别。显而易见，加上 -l 参数后目录下的文件以清单形式展现，你可以清晰的看到文件的类型、所属用户、创建时间等信息。其中第一列你会看到如下信息：</p>
<p>drwxr-xr-x</p>
<p>第一个字母 d 这表示该文件是一个目录（directory）文件，如果是普通文件第一个字母的位置将显示连字符“ - ”。</p>
<p>剩下9个字符以3个为一组，每一组各表示文件对于不同用户的权限，第一组 rwx 表示该文件所属的用户具有读（read）、写（write）和执行（execute）该文件的权限，第二组 r-x 表示同用户组的用户具有读和执行的权限（“ - ”表示不具备相关权限），第三组 r-x 表示其他用户具有读和执行的权限。</p>
<p>当然还有 ls -a列出包括隐藏文件在内的所有文件，Linux 的隐藏文件名以 “ . “开始。</p>
<p>有些Linux发行版会提供 ll 命令，该命令等价于 ls -l ，树莓派默认没有 ll 命令，不过可以通过修改用户主目录下的 .bashrc 文件，找到以下两行：</p>
<p>#alias ll=’ls -l’<br>#alias la=’ls -Al’</p>
<p>把前面的 # 删除，保存后重新进入终端即可使用 ll 命令。</p>
<h2 id="pwd-输出当前目录"><a href="#pwd-输出当前目录" class="headerlink" title="pwd 输出当前目录"></a><strong>pwd 输出当前目录</strong></h2><p>有时候你可能想知道当前在什么目录下，那么可以通过pwd命令打印出出来。pwd就是print working directory（打印当前工作目录）的首字母缩写。</p>
<p>比如，假设你正在如下目录中：</p>
<p>/home/pi/projects/rebot/bin</p>
<p>但终端仅仅显示:</p>
<p>pi@raspberrypi: /bin $</p>
<p>你通过终端显示信息只知道你在 bin 目录下，却不知道全部路径信息，这时候就需要pwd命令。</p>
<h2 id="cd-改变目录"><a href="#cd-改变目录" class="headerlink" title="cd 改变目录"></a><strong>cd 改变目录</strong></h2><p>你可以 cd 到任何你想去的目录，只要你知道它的路径，这个路劲可以是绝对路径，也可以是相对路径。</p>
<p>假设你正在如下目录中：</p>
<p>/home/pi/projects/robot/bin/</p>
<p>你想去往 /home/pi/projects/ 目录，那么你即可以使用绝对路径：</p>
<p>$ cd /home/pi/projects</p>
<p>也可以使用相对路径：</p>
<p>$ cd ../../</p>
<p>其中 ../ 是指上一级目录，在这个例子中，bin目录往上两级就是projects目录。</p>
<p>如果robot目录下，还有一个lib目录和bin目录同级，那么你从bin目录去往lib目录就可以使用：</p>
<p>$ cd ../lib</p>
<p>也就是bin的上级目录下面的lib目录。</p>
<p>此外</p>
<p>输入 cd 命令可以直接回到pi用户的主目录 /home/pi/</p>
<p>输入 cd .. 命令可以回到当前目录的上一级目录</p>
<h2 id="mkdir-新建目录"><a href="#mkdir-新建目录" class="headerlink" title="mkdir 新建目录"></a><strong>mkdir 新建目录</strong></h2><p>如果你要在当前目录下新建一个目录 temp，那么你可以使用：</p>
<p>$ mkdir temp</p>
<p>如果你想把这个temp新建到/home/pi/projects下面，那么你可以使用：</p>
<p>$ mkdir /home/pi/projects/temp</p>
<p>前提是projects这个目录必须存在，并且你对其拥有写权限。</p>
<h2 id="rmdir-删除目录"><a href="#rmdir-删除目录" class="headerlink" title="rmdir 删除目录"></a><strong>rmdir 删除目录</strong></h2><p>如果你要把temp目录删除，可以使用：</p>
<p>$ rmdir temp</p>
<p>或者：</p>
<p>$ rmdir /home/pi/projects/temp</p>
<p>但这要求temp必须是个空空的目录，如果temp中还有其他内容，你可能需要使用：</p>
<p>$ rm -fr temp</p>
<p>系统会把temp及其里面的所有内容全部删除。</p>
<h2 id="cat-显示或连接文件内容"><a href="#cat-显示或连接文件内容" class="headerlink" title="cat 显示或连接文件内容"></a><strong>cat 显示或连接文件内容</strong></h2><p>你发现当前目录下有一个GirlsPhoneNum文件，你可能迫不及待的想看一看，那么你可以使用：</p>
<p>$ cat GirlsPhoneNum</p>
<p>文件的全部内容将会打印在终端。</p>
<p>如果你发现还有一个BoysPhoneNum文件，你想两个文件一起看，那么你可以使用：</p>
<p>$ cat GirlsPhoneNum BoysPhoneNum</p>
<p>是的，男孩和女孩们的手机号码你就都有了。</p>
<h2 id="rm-删除文件"><a href="#rm-删除文件" class="headerlink" title="rm 删除文件"></a><strong>rm 删除文件</strong></h2><p>如果你觉得男孩的手机号码干扰你看更重要的东西，你可以把它删除：</p>
<p>$ rm BoysPhoneNum</p>
<p>这样你就算把回收站全倒出来也找不到它了。</p>
<h2 id="mv-移动-重命名文件-目录"><a href="#mv-移动-重命名文件-目录" class="headerlink" title="mv 移动/重命名文件/目录"></a><strong>mv 移动/重命名文件/目录</strong></h2><p>如果你不想删除男孩儿们的手机号，只是想把他们移动的别的地方去，比如移动到/home/pi/boys，那么你可以：</p>
<p>$ mv BoysPhoneNum /home/pi/boys</p>
<p>前提是boys这个目录必须要存在，如果不存在的话，你需要使用mkdir命令新建一个。</p>
<p>如果你担心女朋友看到你电脑里存了好多女孩的号码，你可以给它改个名字：</p>
<p>$ mv GirlsPhoneNum MyTeachersNum</p>
<h2 id="cp-复制文件-目录"><a href="#cp-复制文件-目录" class="headerlink" title="cp 复制文件/目录"></a><strong>cp 复制文件/目录</strong></h2><p>你可以吧女孩儿们的号码复制到妥当位置，以防被女友删除：</p>
<p>$ cp GirlsPhoneNum /home/pi/Study/Linux/RaspberryPi</p>
<p>如果你要复制整个目录到/home/pi下面：</p>
<p>$ cp -r GirlPhotos /home/pi</p>
<h2 id="echo-显示在终端输入内容"><a href="#echo-显示在终端输入内容" class="headerlink" title="echo 显示在终端输入内容"></a><strong>echo 显示在终端输入内容</strong></h2><p>你可以试试下面的命令会输出什么</p>
<p>$ echo Hello Raspberry Pi</p>
<h2 id="date-读取系统日期-时间"><a href="#date-读取系统日期-时间" class="headerlink" title="date 读取系统日期/时间"></a><strong>date 读取系统日期/时间</strong></h2><p>终端下面并没有系统托盘可以让你看日期和时间，如果你想看时间的话，就要 date 一下。</p>
<h2 id="grep-全面搜索正则表达式并打印"><a href="#grep-全面搜索正则表达式并打印" class="headerlink" title="grep 全面搜索正则表达式并打印"></a><strong>grep 全面搜索正则表达式并打印</strong></h2><p>这是一个功能爆表的命令，它可以通过正则表达式搜索文件或目录，也可以在一些命令的输出内容里进行查找。它的用法几乎可以写一本书，不过我们目前只需要了解一些最简单的用法即可。</p>
<p>比如你想知道刚才那个女孩们的手机号码文件里，有没有你想的JingJing的号码，你可以：</p>
<p>$ grep JingJing GirlsPhoneNum</p>
<h2 id="man-显示命令帮助手册"><a href="#man-显示命令帮助手册" class="headerlink" title="man 显示命令帮助手册"></a><strong>man 显示命令帮助手册</strong></h2><p>如果你不知道某个命令怎么用，或者你忘记了，你可以man一下：</p>
<p>$ man grep</p>
<p>输出的内容可能会让你崩溃，你可以用空格来翻页，回车看下一行，q退出。</p>
<h2 id="sudo-以root权限执行"><a href="#sudo-以root权限执行" class="headerlink" title="sudo 以root权限执行"></a><strong>sudo 以root权限执行</strong></h2><p>树莓派默认使用”pi“用户登录，并且不会启用”root“用户，可能也印证了那句”只有菜鸟才以root身份登录“的Linux极客语录。</p>
<p>那么当你需要使用root身份来执行一些任务的时候，比如你需要把GirlsPhoneNum文件藏在/lib目录下，因为你女朋友无论如何也不会想到去看/lib这个存放库文件的目录，而往/lib目录里写文件一般都是需要root权限的，那么你可以使用sudo：</p>
<p>$ sudo cp GirlsPhoneNum /lib</p>
<p>然后系统会提示你输入当前用户也就是pi用户的密码，输入密码的时候终端里是不显示任何内容的，连星星***也不显示，输入之后按回车即可。</p>
<h2 id="chmod-改变文件读写权限"><a href="#chmod-改变文件读写权限" class="headerlink" title="chmod 改变文件读写权限"></a><strong>chmod 改变文件读写权限</strong></h2><p>刚才介绍ls命令的时候，你大致了解了一个文件的权限可以用下面的形式来表示：</p>
<p>-rwxrwxrwx</p>
<p>如果需要对权限进行修改，就要用到chmod命令，这个命令可以使用直接方式和二进制方式两种来修改权限。</p>
<p><strong>直接方式</strong></p>
<p>u代表文件所属用户<br>g代表与文件所属用户同组的用户<br>o代表其他所有用户</p>
<p>比如一个文件的权限为：</p>
<p>-rwxrwxrwx</p>
<p>你希望其他所有用户仅具有读的权限，可以用命令：</p>
<p>$ chmod o-wx filename</p>
<p>这个文件的权限就变成了：</p>
<p>-rwxrwxr–</p>
<p>如果你想恢复原来的全部可读可写和可执行权限，就使用命令：</p>
<p>$ chmod o+wx filename</p>
<p><strong>数值方式</strong></p>
<p>我更喜欢数值方式，它为每一种权限分配了一个数值：</p>
<p>r = 4<br>w = 2<br>x = 1</p>
<p>将每一组所有权限的数值加起来就可以。比如744，代表文件所属用户具有rwx权限，同组用户和其他所有用户只具有r权限。如果你想将一个文件的权限设置为：</p>
<p>-rwxr-xr-x</p>
<p>那么可以使用命令：</p>
<p>$ chmod 755 filename</p>
<p>也许你有点晕，慢慢来，习惯就好。</p>
<h2 id="program-运行program程序"><a href="#program-运行program程序" class="headerlink" title="./program 运行program程序"></a><strong>./program 运行program程序</strong></h2><p>如果你想运行某个程序（可执行文件），那么直接在终端里输入它的路径就可以，如果你要执行当前目录下的program可执行文件，你需要使用：</p>
<p>$ ./program</p>
<h2 id="apt-get-安装-删除软件包"><a href="#apt-get-安装-删除软件包" class="headerlink" title="apt-get 安装/删除软件包"></a><strong>apt-get 安装/删除软件包</strong></h2><p>那么树莓派下面怎么安装软件呢？或者卸载软件？</p>
<p>一般来讲你并不需要先去某个网站下载，然后安装，你可以直接使用包管理工具apt-get，比如你要安装vim编辑器，你可以：</p>
<p>$ sudo apt-get install vim</p>
<p>如果你想删除它，也很简单：</p>
<p>$ sudo apt-get remove vim</p>
<p>apt-get需要以root权限运行，所以在前面加上sudo。</p>
<p>如果你想对系统和已安装的软件包进行升级：</p>
<p>$ sudo apt-get update<br>$ sudo apt-get upgrade</p>
<p>有些Linux发行版使用yum或者dnf来管理软件包，不过这些和树莓派的Raspbian关系不大。</p>
<p>你也许还听说过用什么make之类的命令编译安装，这种操作可以等你把眼下的东西玩腻了再去搞。</p>
<h2 id="exit-退出"><a href="#exit-退出" class="headerlink" title="exit 退出"></a><strong>exit 退出</strong></h2><p>当你想退出终端，直接输入 exit 即可，表忘了输完按回车键。</p>
<h2 id="reboot-重新启动"><a href="#reboot-重新启动" class="headerlink" title="reboot 重新启动"></a><strong>reboot 重新启动</strong></h2><p>如果你想重新启动系统的话：</p>
<p>$ sudo reboot</p>
<h2 id="shutdown关机"><a href="#shutdown关机" class="headerlink" title="shutdown关机"></a><strong>shutdown关机</strong></h2><p>如果你想立即关闭系统：</p>
<p>$ sudo shutdown -h now</p>

      
    </div>

    
    
    
      <footer class="post-footer">
        <div class="post-eof"></div>
      </footer>
  </article>
  
  
  

      
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="https://ios103.gitee.io/2020/10/12/%E6%A0%91%E8%8E%93%E6%B4%BE3B%E8%A7%84%E6%A0%BC-GPIO%E5%BC%95%E8%84%9A%E5%9B%BE-%E8%B4%9F%E8%BD%BD%E7%94%B5%E6%B5%81%E5%8F%82%E8%80%83/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/blog/images/avatar.gif">
      <meta itemprop="name" content="小龙人">
      <meta itemprop="description" content="">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="小龙人的妙妙屋">
    </span>
      <header class="post-header">
        <h2 class="post-title" itemprop="name headline">
          
            <a href="/blog/2020/10/12/%E6%A0%91%E8%8E%93%E6%B4%BE3B%E8%A7%84%E6%A0%BC-GPIO%E5%BC%95%E8%84%9A%E5%9B%BE-%E8%B4%9F%E8%BD%BD%E7%94%B5%E6%B5%81%E5%8F%82%E8%80%83/" class="post-title-link" itemprop="url">树莓派3B规格-GPIO引脚图-负载电流参考</a>
        </h2>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-calendar"></i>
              </span>
              <span class="post-meta-item-text">发表于</span>
              

              <time title="创建时间：2020-10-12 16:16:35 / 修改时间：17:41:43" itemprop="dateCreated datePublished" datetime="2020-10-12T16:16:35+08:00">2020-10-12</time>
            </span>
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-folder"></i>
              </span>
              <span class="post-meta-item-text">分类于</span>
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/blog/categories/%E6%A0%91%E8%8E%93%E6%B4%BE/" itemprop="url" rel="index"><span itemprop="name">树莓派</span></a>
                </span>
            </span>

          

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
          <p><strong>树莓派3B规格-GPIO引脚图-负载电流参考</strong></p>
<p><a target="_blank" rel="noopener" href="https://qcsunny.github.io/2017/09-14-%E6%A0%91%E8%8E%93%E6%B4%BE3B%E8%A7%84%E6%A0%BC-GPIO%E5%BC%95%E8%84%9A%E5%9B%BE-%E8%B4%9F%E8%BD%BD%E7%94%B5%E6%B5%81%E5%8F%82%E8%80%83/">github</a></p>
<p>树莓派3B规格等，用作备忘</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br></pre></td><td class="code"><pre><span class="line">全选SOC: Broadcom BCM2837芯片</span><br><span class="line">**CPU**: 四核Cortex-A53@1.2GHz，ARMv8架构，32KB一级缓存 512KB二级缓存</span><br><span class="line">**GPU**: 双核VideoCore IV GPU@400MHz，3D core@300MHz，OpenGL ES 2.0，1080p 60fps h.264&#x2F;MPEG-4 AVC</span><br><span class="line">工作温度范围: SOC-40~85°C，LAN9514(0~70°C)</span><br><span class="line">内存: 1GB LPDDR2（900 MHz）</span><br><span class="line">SMSC LAN9514: 4个USB2.0 和10&#x2F;100M Ethernet共享</span><br><span class="line">BCM43438: WiFi（802.11 b&#x2F;g&#x2F;n 2.4GHz）和蓝牙4.1（BLE）,支持无线电</span><br><span class="line">GPIO: 40-pin</span><br><span class="line">视频接口: HDMI1.4</span><br><span class="line">接口: DSI显示屏接口（15-pin）、CSI 2 摄像头接口（15-pin）、3.5mm复合视频输出口、microSD接口</span><br><span class="line">供电: 支持5V 2.5A</span><br></pre></td></tr></table></figure>

<p>GPIO引脚图：<br><a target="_blank" rel="noopener" href="https://qcsunny.github.io/images/rpi-gpio.png"><img src="https://qcsunny.github.io/images/rpi-gpio.png" alt="img"></a></p>
<p>各个版本树莓派在启动、空载、播放视频、满载下电流大小对比：</p>
<table>
<thead>
<tr>
<th align="left"></th>
<th align="center"></th>
<th align="center">Pi1 (B+)</th>
<th align="center">Pi2 B</th>
<th align="center">Pi3 B (amps)</th>
<th align="center">Zero (amps)</th>
</tr>
</thead>
<tbody><tr>
<td align="left">Boot</td>
<td align="center">Max</td>
<td align="center">0.26</td>
<td align="center">0.40</td>
<td align="center">0.75</td>
<td align="center">0.20</td>
</tr>
<tr>
<td align="left"></td>
<td align="center">Avg</td>
<td align="center">0.22</td>
<td align="center">0.22</td>
<td align="center">0.35</td>
<td align="center">0.15</td>
</tr>
<tr>
<td align="left">Idle</td>
<td align="center">Avg</td>
<td align="center">0.20</td>
<td align="center">0.22</td>
<td align="center">0.30</td>
<td align="center">0.10</td>
</tr>
<tr>
<td align="left">Video playback (H.264)</td>
<td align="center">Max</td>
<td align="center">0.30</td>
<td align="center">0.36</td>
<td align="center">0.55</td>
<td align="center">0.23</td>
</tr>
<tr>
<td align="left"></td>
<td align="center">Avg</td>
<td align="center">0.22</td>
<td align="center">0.28</td>
<td align="center">0.33</td>
<td align="center">0.16</td>
</tr>
<tr>
<td align="left">Stress</td>
<td align="center">Max</td>
<td align="center">0.35</td>
<td align="center">0.82</td>
<td align="center">1.34</td>
<td align="center">0.35</td>
</tr>
<tr>
<td align="left"></td>
<td align="center">Avg</td>
<td align="center">0.32</td>
<td align="center">0.75</td>
<td align="center">0.85</td>
<td align="center">0.23</td>
</tr>
</tbody></table>
<p>测试环境：室温，系统Raspbian (26 Feb 2016)，连上HDMI、USB键盘和鼠标，Pi3 B连接上WiFi热点。</p>

      
    </div>

    
    
    
      <footer class="post-footer">
        <div class="post-eof"></div>
      </footer>
  </article>
  
  
  

      
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="https://ios103.gitee.io/2020/10/10/Raspberry%E6%8C%87%E5%8D%97/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/blog/images/avatar.gif">
      <meta itemprop="name" content="小龙人">
      <meta itemprop="description" content="">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="小龙人的妙妙屋">
    </span>
      <header class="post-header">
        <h2 class="post-title" itemprop="name headline">
          
            <a href="/blog/2020/10/10/Raspberry%E6%8C%87%E5%8D%97/" class="post-title-link" itemprop="url">Raspberry指南</a>
        </h2>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-calendar"></i>
              </span>
              <span class="post-meta-item-text">发表于</span>

              <time title="创建时间：2020-10-10 21:06:42" itemprop="dateCreated datePublished" datetime="2020-10-10T21:06:42+08:00">2020-10-10</time>
            </span>
              <span class="post-meta-item">
                <span class="post-meta-item-icon">
                  <i class="far fa-calendar-check"></i>
                </span>
                <span class="post-meta-item-text">更新于</span>
                <time title="修改时间：2020-10-12 17:42:07" itemprop="dateModified" datetime="2020-10-12T17:42:07+08:00">2020-10-12</time>
              </span>
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-folder"></i>
              </span>
              <span class="post-meta-item-text">分类于</span>
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/blog/categories/%E6%A0%91%E8%8E%93%E6%B4%BE/" itemprop="url" rel="index"><span itemprop="name">树莓派</span></a>
                </span>
            </span>

          

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
          <p>把系统烧录进SD卡后，在<code>boot</code>目录下新建一个<code>ssh</code>为名的文件，用于开启<code>ssh</code>连接服务（默认关闭）。<br>在<code>boot</code>目录下新建一个<code>wpa_supplicant.conf</code>为名的文件，打开文件，键入以下内容：</p>
<figure class="highlight sh"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br></pre></td><td class="code"><pre><span class="line">country=CN</span><br><span class="line">ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev</span><br><span class="line">update_config=1</span><br><span class="line"> </span><br><span class="line">network=&#123;</span><br><span class="line">        ssid=<span class="string">&quot;WiFi-A&quot;</span></span><br><span class="line">        psk=<span class="string">&quot;12345678&quot;</span></span><br><span class="line">        key_mgmt=WPA-PSK</span><br><span class="line">        priority=1</span><br><span class="line">&#125;</span><br><span class="line">network=&#123;</span><br><span class="line">        ssid=<span class="string">&quot;WiFi-B&quot;</span></span><br><span class="line">        psk=<span class="string">&quot;12345678&quot;</span></span><br><span class="line">        key_mgmt=WPA-PSK</span><br><span class="line">        priority=2</span><br><span class="line">        scan_ssid=1</span><br><span class="line">&#125;</span><br><span class="line">network=&#123;</span><br><span class="line">        ssid=<span class="string">&quot;你的无线网络名称（ssid）&quot;</span></span><br><span class="line">        key_mgmt=NONE</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>

<blockquote>
<p>说明以及不同安全性的 WiFi 配置示例：<br>**#ssid:网络的ssid**<br><strong>#psk:密码</strong><br><strong>#priority:连接优先级，数字越大优先级越高（不可以是负数）</strong><br><strong>#scan_ssid:连接隐藏WiFi时需要指定该值为1</strong></p>
</blockquote>
<p><a target="_blank" rel="noopener" href="https://shumeipai.nxez.com/2017/09/13/raspberry-pi-network-configuration-before-boot.html">无屏幕和键盘配置树莓派WiFi和SSH</a></p>
<h3 id="虚拟键盘"><a href="#虚拟键盘" class="headerlink" title="#虚拟键盘"></a>#虚拟键盘</h3><figure class="highlight sh"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">sudo apt-get install matchbox-keyboard <span class="comment">#系统自带 DISPLAY=:0.0 matchbox-keyboard -s 100 extended</span></span><br><span class="line">sudo apt-get install Florence</span><br></pre></td></tr></table></figure>



<p>####修改Swap</p>
<p>树莓派默认的虚拟内存大小才100M，有时候我们需要扩大它，这里我们修改的是/etc/dphys-swapfile</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">sudo vim &#x2F;etc&#x2F;dphys-swapfile</span><br></pre></td></tr></table></figure>

<p>将这一行的100修改为你想要的值，单位是兆（M）</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">CONF_SWAPSIZE&#x3D;100</span><br></pre></td></tr></table></figure>

<p>保存退出后，运行</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">sudo &#x2F;etc&#x2F;init.d&#x2F;dphys-swapfile restart</span><br></pre></td></tr></table></figure>

<p>重启dphys-swapfile服务，然后使用命令</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">free -h</span><br></pre></td></tr></table></figure>

<p>查看是否成功</p>
<p><code>use dphys-swapfile swap[on|off] for that</code></p>
<p>####树莓派如何安全关机重启</p>
<p>选择有很多一行一个关机方法。</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">sudo shutdown -h now</span><br><span class="line">sudo halt </span><br><span class="line">sudo poweroff </span><br><span class="line">sudo init 0</span><br></pre></td></tr></table></figure>

<p>重启方法。</p>
<figure class="highlight sh"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">sudo reboot</span><br><span class="line">shutdown -r now </span><br><span class="line">shutdown -r 18:23:52 <span class="comment">#定时重启在18点23分52秒关闭</span></span><br></pre></td></tr></table></figure>

<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">man command #查看命令的使用手册。command 替换成你想了解的任何命令。</span><br></pre></td></tr></table></figure>

<h5 id="终端怎么退出python命令行"><a href="#终端怎么退出python命令行" class="headerlink" title="终端怎么退出python命令行"></a>终端怎么退出python命令行</h5><p><code>使用 quit(), exit(), 或者Command+d，或者Command+z退出命令行。</code></p>
<h4 id="树莓派-配置中文环境"><a href="#树莓派-配置中文环境" class="headerlink" title="树莓派 配置中文环境"></a>树莓派 配置中文环境</h4><figure class="highlight sh"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">#更新软件安装库</span></span><br><span class="line">sudo apt-get update</span><br><span class="line"><span class="comment">#安装中文字库</span></span><br><span class="line">sudo apt-get install ttf-wqy-zenhei</span><br><span class="line"></span><br><span class="line">1.</span><br><span class="line"><span class="comment">#安装scim中文输入法</span></span><br><span class="line">sudo apt-get install scim-pinyin</span><br><span class="line">sudo scim <span class="comment">#Smart Common Input Method </span></span><br><span class="line">2.</span><br><span class="line"><span class="comment">#小企鹅输入法 (Fcitx)</span></span><br><span class="line">sudo apt-get install fcitx <span class="comment">#（安装fcitx）</span></span><br><span class="line">sudo apt-get install fcitx-pinyin <span class="comment">#（安装拼音）</span></span><br><span class="line">sudo fcitx</span><br><span class="line">3.</span><br><span class="line"><span class="comment">#安装fcitx及google拼音输入法</span></span><br><span class="line">sudo apt-get install fcitx fcitx-googlepinyin fcitx-module-cloudpinyin</span><br><span class="line"></span><br><span class="line"><span class="comment">#在terminal里面输入：</span></span><br><span class="line">sudo raspi-config</span><br><span class="line"><span class="comment">#进入bios界面找到localtion option 回车;</span></span><br><span class="line"><span class="comment">#再找到change locale 回车;</span></span><br><span class="line"><span class="comment">#找到</span></span><br><span class="line">en-GB.UTF-8 UTF-8</span><br><span class="line">zh_CN.GB2312</span><br><span class="line">zh.CN.GB18030 GB18030</span><br><span class="line">zh_CN.GBK GBK</span><br><span class="line">zh_CN.UTF-8 UTF-8</span><br><span class="line">点击空格键（重点，千万别忘记点空格键），然后回车，选择zh_CN.UTF-8 UTF-8 为默认语言。等待结束回到bios界面后点击键盘上的esc键退出bios界面，输入sudo reboot 重启树莓派;</span><br><span class="line"></span><br><span class="line"><span class="comment">#备注</span></span><br><span class="line"><span class="comment">#树莓派安装scim-pinyin 安装后ctrl+space不能切换</span></span><br><span class="line"><span class="comment">#~/.scim整个目录全部删掉，重新安装</span></span><br><span class="line"></span><br><span class="line"><span class="comment">#包管理工具apt的图形化前端</span></span><br><span class="line">sudo apt-get install synaptic</span><br></pre></td></tr></table></figure>



<h5 id="树莓派屏幕黑边"><a href="#树莓派屏幕黑边" class="headerlink" title="树莓派屏幕黑边"></a>树莓派屏幕黑边</h5><blockquote>
<p>点击左上角树莓派图标–&gt;首选项–&gt;Raspberry Pi Configuration(树莓派配置)；</p>
<p>切换到display的TAB页， 将第一项Overscan选项修改为Disable；</p>
</blockquote>
<h5 id="如何检查树莓派的硬件版本号和型号"><a href="#如何检查树莓派的硬件版本号和型号" class="headerlink" title="如何检查树莓派的硬件版本号和型号"></a>如何检查树莓派的硬件版本号和型号</h5><blockquote>
<p>1.pinout<br>该方法还能查看其他信息，比如在树莓派上的各个GPIO针的GPIO编号位置和所板载的RAM数量。</p>
</blockquote>
<blockquote>
<p>2.cat /proc/cpuinfo<br>通用的查找树莓派硬件修订号的方法</p>
</blockquote>
<blockquote>
<p>3.cat /proc/device-tree/model</p>
<p>检查树莓派的型号</p>
</blockquote>
<blockquote>
<p>我们可以使用sysbench来运行一个简单的CPU基准测试和看看验证质数所需的时间。<br><code>$ sysbench --test=cpu --num-threads=4 --cpu-max-prime=9999 run</code></p>
</blockquote>
<h4 id="开机启动python脚本"><a href="#开机启动python脚本" class="headerlink" title="开机启动python脚本"></a>开机启动python脚本</h4><p>1./etc/rc.local</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><span class="line">systemctl enable rc-local.service #默认下的rc-local.service是关闭的，需要将它启动</span><br><span class="line">sudo vi /etc/rc.local #编辑rc.local文件</span><br><span class="line"></span><br><span class="line"><span class="meta">#</span><span class="bash">在<span class="built_in">exit</span> 0之前编写好要启动的python脚本的绝对路径和文件名称</span></span><br><span class="line"><span class="meta">#</span><span class="bash">我的python脚本 bluetooth_control.py 放在桌面， /home/pi/Desktop/4wd_car/bluetooth_control.py</span></span><br><span class="line"><span class="meta">#</span><span class="bash">因为脚本里使用的<span class="keyword">while</span>循环，所以要添加一个 &amp;</span></span><br><span class="line">...</span><br><span class="line">python /home/pi/Desktop/4wd_car/bluetooth_control.py &amp; #add</span><br><span class="line">exit 0</span><br></pre></td></tr></table></figure>

<p>**重启树莓派 ** <code>sudo reboot</code></p>
<p>脚本方式</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta">#</span><span class="bash">1</span></span><br><span class="line">pi@zero:~/Documents/Internet $ sudo nano test.sh #新建运行脚本</span><br><span class="line"></span><br><span class="line"><span class="meta">#</span><span class="bash">编辑内容</span></span><br><span class="line"><span class="meta">#</span><span class="bash">!/bin/sh</span></span><br><span class="line">cd /home/pi/Documents/Internet</span><br><span class="line">/usr/bin/python3 test.py &gt; test.log &amp;</span><br><span class="line"></span><br><span class="line"><span class="meta">#</span><span class="bash">2</span></span><br><span class="line">pi@zero:~/Documents/Internet $ sudo chmod +x test.sh #赋予脚本可执行权限</span><br><span class="line"></span><br><span class="line"><span class="meta">#</span><span class="bash">3</span></span><br><span class="line"><span class="meta">#</span><span class="bash">编辑rc.local</span></span><br><span class="line">root@zero:~# nano /etc/rc.local</span><br><span class="line"></span><br><span class="line"><span class="meta">#</span><span class="bash"> 在<span class="built_in">exit</span> 0 之前添加脚本运行路径</span></span><br><span class="line">/home/pi/Documents/Internet/./test.sh &amp;</span><br><span class="line"></span><br><span class="line">exit 0</span><br><span class="line"></span><br><span class="line"><span class="meta">#</span><span class="bash">4</span></span><br><span class="line"><span class="meta">#</span><span class="bash">赋予rc.local可执行权限并重启</span></span><br><span class="line">root@zero:~# sudo chmod +x rc.local</span><br><span class="line">root@zero:~# sudo reboot</span><br></pre></td></tr></table></figure>

<p>2.autostart</p>
<blockquote>
<p>这个方式不用修改 rc.local 文件。机制上类似于 Windows 的“开始”菜单中的“启动”菜单。方法如下：在 /home/pi/.config 下创建一个文件夹，名称为 autostart，并在该文件夹下创建一个xxx.desktop文件（文件名以.desktop结尾，前面可以自定义），文件内容如下：</p>
</blockquote>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br></pre></td><td class="code"><pre><span class="line">[Desktop Entry]</span><br><span class="line">Name=example</span><br><span class="line">Comment=My Python Program</span><br><span class="line">Exec=python /home/pi/example.py</span><br><span class="line">Icon=/home/pi/example.png</span><br><span class="line">Terminal=false</span><br><span class="line">MultipleArgs=false</span><br><span class="line">Type=Application</span><br><span class="line">Categories=Application;Development;</span><br><span class="line">StartupNotify=true</span><br><span class="line"></span><br></pre></td></tr></table></figure>

<blockquote>
<p>以上 Name、Comment、Icon 可以自定，分别表示这个启动项目的名称、备注以及显示的图标。Exec 表示调用的指令，和在终端输入运行脚本的指令格式一致。<br>之后 sudo reboot 重启，就可以看到 example.py 在树莓派启动后也自动启动了。</p>
</blockquote>
<p>3.服务</p>
<p><a target="_blank" rel="noopener" href="https://shumeipai.nxez.com/2020/06/30/linux-usage-systemd.html">Linux 下使用 systemd 设置开机启动项</a></p>
<h6 id="Root启用管理员"><a href="#Root启用管理员" class="headerlink" title="Root启用管理员"></a>Root启用管理员</h6><figure class="highlight sh"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">#设置密码</span></span><br><span class="line">sudo passwd root</span><br><span class="line"><span class="comment">#解锁</span></span><br><span class="line">sudo passwd --unlock root</span><br><span class="line"><span class="comment">#切换</span></span><br><span class="line">su root</span><br></pre></td></tr></table></figure>



<p>#####NES游戏</p>
<p><code>sudo apt-get install nestopia</code></p>
<p>#####常用命令</p>
<table>
<thead>
<tr>
<th>command</th>
<th>into</th>
</tr>
</thead>
<tbody><tr>
<td>ls</td>
<td>ls是英文单词list的缩写.用来查看文件目录的属性。</td>
</tr>
<tr>
<td>stat</td>
<td>查看文件的访问时间，修改时间等</td>
</tr>
<tr>
<td>cd</td>
<td>cd 是 change directory的缩写，表示改变当前所在路径。<br /><code>cd ..</code> 上级目录 <code>cd /</code> 根目录 <code>cd ～</code>当前用户的主目录 <code>cd -</code> 上次所在目录</td>
</tr>
<tr>
<td>pwd</td>
<td>pwd 是英文print working directory 显示当前所在路径。</td>
</tr>
<tr>
<td>which</td>
<td>寻找可执行文件 ，并在PATH环境变量里面寻找</td>
</tr>
<tr>
<td>touch</td>
<td>将每个文件的访问及修改时间都更新为目前的时间。<br />如果文件不存在，则创建一个字节数为0的文件。</td>
</tr>
<tr>
<td>mkdir</td>
<td>mkdir 是make directory的英文缩写。<br />创建目录DIRECTORY，可以一次创建多个。OPTION如果是­p，表示可以连同父目录一起创建。</td>
</tr>
<tr>
<td>rmdir</td>
<td>rmdir是remove directory的英文缩写。</td>
</tr>
<tr>
<td>rm</td>
<td>rm是remove的英文缩写。<br />可以用来删除普通文件，也可以用来删除目录，特别用来删除目录中嵌套有子目录的目录文件。<br/>常用参数：</td>
</tr>
<tr>
<td>mv</td>
<td>mv是英文单词move的缩写。可以用来移动文件夹或者文件，也可以用来更改文件名。</td>
</tr>
<tr>
<td>cp</td>
<td>cp是英文单词copy的缩写，表示拷贝文件。</td>
</tr>
<tr>
<td>cat</td>
<td>cat英文单词concatenate连锁的缩写，用来查看文件内容，以及将几个文件连成一个文件</td>
</tr>
<tr>
<td>more</td>
<td>more 是我们最常用的工具之一，最常用的就是显示输出的内容，然后根据窗口的大小进行分页显示，并且提示文件的百分比。</td>
</tr>
<tr>
<td>less</td>
<td>less工具也是对文件或其它输出进行分页显示的工具</td>
</tr>
<tr>
<td>tree -d</td>
<td>显示目录树</td>
</tr>
<tr>
<td>clear</td>
<td>清除终端窗口</td>
</tr>
<tr>
<td>sudo halt:</td>
<td>关闭Raspberry Pi</td>
</tr>
<tr>
<td>sudo reboot</td>
<td>重新启动Raspberry Pi</td>
</tr>
<tr>
<td>startx</td>
<td>启动桌面环境（LXDE）</td>
</tr>
</tbody></table>
<p>#####文件和文件夹操作权限：</p>
<table>
<thead>
<tr>
<th align="left">权限</th>
<th align="left">简写</th>
<th align="left">对普通文件的作用</th>
<th align="left">对文件夹的作用</th>
</tr>
</thead>
<tbody><tr>
<td align="left">读取</td>
<td align="left">r</td>
<td align="left">查看文件内容</td>
<td align="left">列出文件夹中的文件(ls)</td>
</tr>
<tr>
<td align="left">写入</td>
<td align="left">w</td>
<td align="left">修改文件内容</td>
<td align="left">在文件夹中删除、添加或重命名文件(夹)</td>
</tr>
<tr>
<td align="left">执行</td>
<td align="left">x</td>
<td align="left">文件可以作为程序执行</td>
<td align="left">cd 到文件夹</td>
</tr>
</tbody></table>
<p><img src="https://img-blog.csdn.net/20180410164648555?watermark/2/text/aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3piajE4MzE0NDY5Mzk1/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70" alt="图解"></p>
<p><img src="https://img-blog.csdn.net/20180410164735787?watermark/2/text/aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3piajE4MzE0NDY5Mzk1/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70" alt="图解"></p>
<p>#####SSH</p>
<blockquote>
<p>软件配置工具 Raspberry Pi Software Configuration Tool(raspi-config)</p>
</blockquote>
<p><code>sudo raspi-config</code><br><a target="_blank" rel="noopener" href="https://blog.csdn.net/weixin_42455305/article/details/80687002">树莓派官方设置工具 raspi-config 说明</a></p>
<blockquote>
<p>SSH的默认端口是22，也就是说，你的登录请求会送进远程主机的22端口。使用p参数，可以修改这个端口。</p>
<p>ssh -p 2222 user@host</p>
</blockquote>
<p>#####NTP(Network Time Protocol)</p>
<blockquote>
<p>树莓派默认安装了NTP(Network Time Protocol)服务来获取互联网上ntp服务器提供的时间</p>
<p>在 <code>/etc/ntp.conf</code> 中添加一行 <code>server ntp.tuna.tsinghua.edu.cn</code> 即可(清华源)<br>末尾加上 <code>perfer</code>表示优先使用此服务器</p>
</blockquote>
<figure class="highlight sh"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">sudo /etc/init.d/ntp restart</span><br></pre></td></tr></table></figure>

<p>#####更换国内源</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta">#</span><span class="bash">1.修改 sources.list 文件</span></span><br><span class="line">sudo nano /etc/apt/sources.list</span><br><span class="line"><span class="meta">#</span><span class="bash">用<span class="comment">#注释掉原文件内容，用以下内容取代：</span></span></span><br><span class="line">deb http://mirrors.tuna.tsinghua.edu.cn/raspbian/raspbian/ buster main non-free contrib rpi</span><br><span class="line">deb-src http://mirrors.tuna.tsinghua.edu.cn/raspbian/raspbian/ buster main non-free contrib rpi</span><br><span class="line"></span><br><span class="line"><span class="meta">#</span><span class="bash">这里我用的是是清华源，在后面若下载出错换中科大源试试（Ps：中科大的源地址http://mirrors.ustc.edu.cn/raspbian/raspbian/对应替换就行)</span></span><br><span class="line"></span><br><span class="line"><span class="meta">#</span><span class="bash">②在终端输入以下指令**</span></span><br><span class="line">sudo nano /etc/apt/sources.list.d/raspi.list</span><br><span class="line"><span class="meta">#</span><span class="bash">用<span class="comment">#注释掉原文件内容，用以下内容取代：</span></span></span><br><span class="line">deb http://mirrors.tuna.tsinghua.edu.cn/raspberrypi/ buster main ui</span><br><span class="line">deb-src http://mirrors.tuna.tsinghua.edu.cn/raspberrypi/ buster main ui</span><br><span class="line"></span><br><span class="line"><span class="meta">#</span><span class="bash">③使用命令更新软件源列表，同时检查编辑是否正确。再更新软件</span></span><br><span class="line">sudo apt-get update</span><br><span class="line">sudo apt-get upgrade</span><br><span class="line"></span><br></pre></td></tr></table></figure>


<p>#####软件安装命令apt-get</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta">#</span><span class="bash">安装包</span></span><br><span class="line">sudo apt-get install xxx </span><br><span class="line"></span><br><span class="line"><span class="meta">#</span><span class="bash">强制安装</span></span><br><span class="line">sudo apt-get -f install xxx</span><br><span class="line"></span><br><span class="line"><span class="meta">#</span><span class="bash">重新安装</span></span><br><span class="line">sudo apt-get reinstall xxx</span><br><span class="line"></span><br><span class="line"><span class="meta">#</span><span class="bash">删除包</span></span><br><span class="line">sudo apt-get remove xxx</span><br><span class="line"></span><br><span class="line"><span class="meta">#</span><span class="bash">删除包，包括删除配置文件等</span></span><br><span class="line">sudo apt-get remove xxx --purge</span><br><span class="line"></span><br><span class="line"><span class="meta">#</span><span class="bash">删除包及其依赖的软件包+配置文件等（只对6.10有效，强烈推荐）</span></span><br><span class="line">sudo apt-get autoremove xxx --purge</span><br><span class="line"></span><br><span class="line"><span class="meta">#</span><span class="bash">更新软件列表</span></span><br><span class="line">sudo apt-get update</span><br><span class="line"></span><br><span class="line"><span class="meta">#</span><span class="bash">更新所有已安装的包</span></span><br><span class="line">sudo apt-get upgrade</span><br><span class="line"></span><br><span class="line"><span class="meta">#</span><span class="bash">升级系统</span></span><br><span class="line">sudo apt-get dist-upgrade</span><br><span class="line"></span><br><span class="line"><span class="meta">#</span><span class="bash">下载该包的源代码</span></span><br><span class="line">apt-get source xxx</span><br><span class="line"></span><br><span class="line"><span class="meta">#</span><span class="bash">清理下载文件的存档 &amp;&amp; 只清理过时的包</span></span><br><span class="line">sudo apt-get clean &amp;&amp; sudo apt-get autoclean</span><br><span class="line"></span><br><span class="line"><span class="meta">#</span><span class="bash">检查是否有损坏的依赖</span></span><br><span class="line">sudo apt-get check</span><br><span class="line"></span><br><span class="line">注：apt-get新下载的软件包位置</span><br><span class="line">/var/cache/apt/archieve下的都是软件的安装缓存</span><br><span class="line">sudo apt-get autoclean（只删除低版本的deb包）</span><br><span class="line">sudo apt-get clean（全部删除）</span><br><span class="line">一般的deb包都安装在：/usr或/usr/share或/usr/local目录中</span><br></pre></td></tr></table></figure>

<h5 id="软件"><a href="#软件" class="headerlink" title="软件"></a>软件</h5><figure class="highlight sh"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">sudo apt install gedit <span class="comment">#gedit编辑器</span></span><br></pre></td></tr></table></figure>

<blockquote>
<p>OpenMediaVault，是一个开源的基于 Debian Linux 的下一代网络附加存储（NAS）解决方案</p>
</blockquote>
<p><a target="_blank" rel="noopener" href="https://shumeipai.nxez.com/2020/09/22/getting-started-with-omv-on-a-raspberry-pi.html">在树莓派上安装 OpenMediaVault（OMV）</a></p>
<p><a target="_blank" rel="noopener" href="https://shumeipai.nxez.com/2020/09/11/pishrink-make-raspberry-pi-images-smaller.html">PiShrink：制作更小的树莓派镜像文件</a></p>
<h4 id="文章"><a href="#文章" class="headerlink" title="文章"></a>文章</h4><p><a target="_blank" rel="noopener" href="https://www.basemu.com/raspberry-4-raspbian-buster-modification-sources-list.html">更换软件源</a></p>
<p><a target="_blank" rel="noopener" href="https://shumeipai.nxez.com/2013/12/26/linux-on-vim-editor-tutorials.html">Linux上vi(vim)编辑器使用教程</a></p>
<p><a target="_blank" rel="noopener" href="https://shumeipai.nxez.com/2014/09/06/raspberry-pi-vim-code-highlighting.html">树莓派vim代码高亮</a></p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><span class="line">sudo apt-get remove vim-common</span><br><span class="line">sudo apt-get install vim #安装vim</span><br><span class="line">pi@raspberrypi ~ $ cd ~</span><br><span class="line">pi@raspberrypi ~ $ vim .vimrc</span><br><span class="line"> </span><br><span class="line"><span class="meta">#</span><span class="bash">编辑内容</span></span><br><span class="line">set nu  #显示行号</span><br><span class="line">syntax on  #语法高亮</span><br><span class="line">set tabstop=4  #tab退四格</span><br></pre></td></tr></table></figure>

<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">sudo apt install retext #Markdown 编辑器 </span><br></pre></td></tr></table></figure>

<p><a target="_blank" rel="noopener" href="https://shumeipai.nxez.com/2014/11/17/raspberry-pi-taking-screenshots-with-scrot.html">在树莓派上截屏的方法</a></p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">sudo apt-get install scrot #安装</span><br><span class="line">sudo scrot -h #帮助</span><br></pre></td></tr></table></figure>

<p><a target="_blank" rel="noopener" href="https://shumeipai.nxez.com/2015/01/03/raspberry-pi-software-installation-and-uninstallation-command.html">树莓派上的软件安装和卸载命令汇总</a></p>
<p><a target="_blank" rel="noopener" href="https://shumeipai.nxez.com/2018/01/05/directory-introduction-in-raspbian.html">Linux/Raspbian 每个目录用途说明</a></p>
<table>
<thead>
<tr>
<th>目录</th>
<th>注释</th>
</tr>
</thead>
<tbody><tr>
<td>/</td>
<td>根路径</td>
</tr>
<tr>
<td>/boot</td>
<td>启动文件（boot loader）</td>
</tr>
<tr>
<td>/sys</td>
<td>目录下包含内核、固件以及系统相关文件</td>
</tr>
<tr>
<td>/sbin</td>
<td>包含系统操作和运作所必需的二进制文件以及管理工具，<br />主要就是可执行文件。类似WINDOWS下的EXE文件</td>
</tr>
<tr>
<td>/bin</td>
<td>包含单用户模式下的二进制文件以及工具程序，比如cat，ls，cp这些命令</td>
</tr>
<tr>
<td>/lib</td>
<td>包含/sbin和/bin目录下二进制文件运行所需要的库文件</td>
</tr>
<tr>
<td>/dev</td>
<td>内含必需的系统文件和驱动器</td>
</tr>
<tr>
<td>/etc</td>
<td>内含系统配置文件，其下的目录，比如 /etc/hosts, /etc/resolv.conf, nsswitch.conf, 以及系统缺省设置，网络配置文件等等。以及一些系统和应用程序的配置文件</td>
</tr>
<tr>
<td>/home</td>
<td>每一个用户的在这个目录下，都会单独有一个以其用户名命令的目录，在这里保存着用户的个人设置文件，尤其是以 profile结尾的文件。但是也有例外，root用户的数据就不在这个目录中，而是单独在根路径下，保存在单独的/root文件夹下</td>
</tr>
<tr>
<td>/media</td>
<td>一个给所有可移动设备比如光驱、USB外接盘、软盘提供的常规挂载点。</td>
</tr>
<tr>
<td>/mnt</td>
<td>临时文件系统挂载点。比如，你并不想长期挂载某个驱动器，而是只是临时挂载一会U盘烤个MP3之类的，那么应该挂载在这个位置下。</td>
</tr>
<tr>
<td>/opt</td>
<td>在Linux系统中，这个目录用到的并不多，opt是 可选系统程序包（Optional Software Packages）的简称。这个目录在UNIX系统，如Sun Solaris用途要广泛的多。</td>
</tr>
<tr>
<td>/usr</td>
<td>用户数据目录，包含了属于用户的实用程序和应用程序。这里有很多重要的，但并非关键的文件系统挂载这个路径下面。在这里，你会重新找到一个 bin、sbin 和 lib目录，其中包含非关键用户和系统二进制文件以及相关的库和共享目录，以及一些库文件。</td>
</tr>
<tr>
<td>/usr/sbin</td>
<td>包含系统中非必备和并不是特别重要的系统二进制文件以及网络应用工具。</td>
</tr>
<tr>
<td>/usr/bin</td>
<td>包含用户的非必备和并不是特别重要的二进制文件。</td>
</tr>
<tr>
<td>/usr/lib</td>
<td>保存着/usr/sbin以及/usr/bin中二进制文件所需要的库文件。</td>
</tr>
<tr>
<td>/usr/share</td>
<td>“平台无关”的共享数据目录。</td>
</tr>
<tr>
<td>/usr/local</td>
<td>是/usr下的二级目录，这里主要保存着包含系统二进制文件以及运行库在内的本地系统数据。</td>
</tr>
<tr>
<td>/var</td>
<td>这个路径下通常保存着包括系统日志、打印机后台文件（spool files）、定时任务（crontab）、邮件、运行进程、进程锁文件等。这个目录尤其需要注意进行日常的检查和维护，因为这个目录下文件的大小可能会增长很快，以致于很快占满硬盘，然后导致系统便会出现各种奇奇怪怪的问题。</td>
</tr>
<tr>
<td>/tmp</td>
<td>顾名思义，这是一个临时文件夹，专门用来保存临时文件，每次系统重启之后，这个目录下的”临时”文件便会被清空。同样，/var/tmp 也同样保存着临时文件。两者唯一的不同是，后者 /var/tmp目录保存的文件会受到系统保护，系统重启之后这个目录下的文件也不会被清空。</td>
</tr>
<tr>
<td>/proc</td>
<td>这个目录是驻留在系统内存中的虚拟（psuedo，伪）文件系统，其中保存的都是文本格式的系统内核和进程信息。</td>
</tr>
</tbody></table>
<h4 id="LINUX系统目录结构图"><a href="#LINUX系统目录结构图" class="headerlink" title="LINUX系统目录结构图"></a>LINUX系统目录结构图</h4><p><img src="https://shumeipai.nxez.com/wp-content/uploads/2018/01/20180105115447531.png" alt="目录结构"></p>
<p><a target="_blank" rel="noopener" href="https://shumeipai.nxez.com/2019/12/11/scheduling-tasks-with-cron.html">树莓派计划任务的配置方法</a></p>
<p><a target="_blank" rel="noopener" href="https://shumeipai.nxez.com/2018/08/31/raspberry-pi-vnc-viewer-configuration-tutorial.html">树莓派 VNC Viewer 远程桌面配置教程</a></p>
<p><a target="_blank" rel="noopener" href="https://shumeipai.nxez.com/2019/07/08/set-the-resolution-of-the-raspberry-pi-vnc.html">如何设置树莓派 VNC 的分辨率</a></p>
<blockquote>
<p>VNC许可密钥<br>输入一个有效的密钥：5D7L8-ZQXSA-2L5D4-4UFB4-PWDLA   或77NVU-D9G5T-79ESS-V9Y6X-JMVGA</p>
<p>ELBMU-ZFYMV-2HC77-73M46-UL4TA97KLJ-VBTAL-T7GN2-K29PS-ANXCA45YV6-WXWMJ-NPAAV-HWD7Q-W5HVAL76HR-6428G-Q8JAX-7PSSH-ZWYKAEQ48W-C5MQJ-44A2K-5GB2T-NECWA</p>
</blockquote>
<p><a target="_blank" rel="noopener" href="https://ipcmen.com/">Linux命令大全（手册）-Linux常用命令实例详解</a></p>
<p><a target="_blank" rel="noopener" href="https://zhuanlan.zhihu.com/p/59012890">树莓派入门必会的20个Linux命令</a></p>
<p><a target="_blank" rel="noopener" href="https://zhuanlan.zhihu.com/p/59144799">树莓派初次启动后的设置</a></p>

      
    </div>

    
    
    
      <footer class="post-footer">
        <div class="post-eof"></div>
      </footer>
  </article>
  
  
  

      
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="https://ios103.gitee.io/2020/10/10/hello-world/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/blog/images/avatar.gif">
      <meta itemprop="name" content="小龙人">
      <meta itemprop="description" content="">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="小龙人的妙妙屋">
    </span>
      <header class="post-header">
        <h2 class="post-title" itemprop="name headline">
          
            <a href="/blog/2020/10/10/hello-world/" class="post-title-link" itemprop="url">Hello World</a>
        </h2>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-calendar"></i>
              </span>
              <span class="post-meta-item-text">发表于</span>

              <time title="创建时间：2020-10-10 20:26:38" itemprop="dateCreated datePublished" datetime="2020-10-10T20:26:38+08:00">2020-10-10</time>
            </span>

          

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
          <p>Welcome to <a target="_blank" rel="noopener" href="https://hexo.io/">Hexo</a>! This is your very first post. Check <a target="_blank" rel="noopener" href="https://hexo.io/docs/">documentation</a> for more info. If you get any problems when using Hexo, you can find the answer in <a target="_blank" rel="noopener" href="https://hexo.io/docs/troubleshooting.html">troubleshooting</a> or you can ask me on <a target="_blank" rel="noopener" href="https://github.com/hexojs/hexo/issues">GitHub</a>.</p>
<h2 id="Quick-Start"><a href="#Quick-Start" class="headerlink" title="Quick Start"></a>Quick Start</h2><h3 id="Create-a-new-post"><a href="#Create-a-new-post" class="headerlink" title="Create a new post"></a>Create a new post</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$ hexo new <span class="string">&quot;My New Post&quot;</span></span><br></pre></td></tr></table></figure>

<p>More info: <a target="_blank" rel="noopener" href="https://hexo.io/docs/writing.html">Writing</a></p>
<h3 id="Run-server"><a href="#Run-server" class="headerlink" title="Run server"></a>Run server</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$ hexo server</span><br></pre></td></tr></table></figure>

<p>More info: <a target="_blank" rel="noopener" href="https://hexo.io/docs/server.html">Server</a></p>
<h3 id="Generate-static-files"><a href="#Generate-static-files" class="headerlink" title="Generate static files"></a>Generate static files</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$ hexo generate</span><br></pre></td></tr></table></figure>

<p>More info: <a target="_blank" rel="noopener" href="https://hexo.io/docs/generating.html">Generating</a></p>
<h3 id="Deploy-to-remote-sites"><a href="#Deploy-to-remote-sites" class="headerlink" title="Deploy to remote sites"></a>Deploy to remote sites</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$ hexo deploy</span><br></pre></td></tr></table></figure>

<p>More info: <a target="_blank" rel="noopener" href="https://hexo.io/docs/one-command-deployment.html">Deployment</a></p>

      
    </div>

    
    
    
      <footer class="post-footer">
        <div class="post-eof"></div>
      </footer>
  </article>
  
  
  


  



          </div>
          

<script>
  window.addEventListener('tabs:register', () => {
    let { activeClass } = CONFIG.comments;
    if (CONFIG.comments.storage) {
      activeClass = localStorage.getItem('comments_active') || activeClass;
    }
    if (activeClass) {
      let activeTab = document.querySelector(`a[href="#comment-${activeClass}"]`);
      if (activeTab) {
        activeTab.click();
      }
    }
  });
  if (CONFIG.comments.storage) {
    window.addEventListener('tabs:click', event => {
      if (!event.target.matches('.tabs-comment .tab-content .tab-pane')) return;
      let commentClass = event.target.classList[1];
      localStorage.setItem('comments_active', commentClass);
    });
  }
</script>

        </div>
          
  
  <div class="toggle sidebar-toggle">
    <span class="toggle-line toggle-line-first"></span>
    <span class="toggle-line toggle-line-middle"></span>
    <span class="toggle-line toggle-line-last"></span>
  </div>

  <aside class="sidebar">
    <div class="sidebar-inner">

      <ul class="sidebar-nav motion-element">
        <li class="sidebar-nav-toc">
          文章目录
        </li>
        <li class="sidebar-nav-overview">
          站点概览
        </li>
      </ul>

      <!--noindex-->
      <div class="post-toc-wrap sidebar-panel">
      </div>
      <!--/noindex-->

      <div class="site-overview-wrap sidebar-panel">
        <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
  <p class="site-author-name" itemprop="name">小龙人</p>
  <div class="site-description" itemprop="description"></div>
</div>
<div class="site-state-wrap motion-element">
  <nav class="site-state">
      <div class="site-state-item site-state-posts">
          <a href="/blog/archives/">
        
          <span class="site-state-item-count">7</span>
          <span class="site-state-item-name">日志</span>
        </a>
      </div>
      <div class="site-state-item site-state-categories">
            <a href="/blog/categories/">
          
        <span class="site-state-item-count">2</span>
        <span class="site-state-item-name">分类</span></a>
      </div>
  </nav>
</div>



      </div>

    </div>
  </aside>
  <div id="sidebar-dimmer"></div>


      </div>
    </main>

    <footer class="footer">
      <div class="footer-inner">
        

        

<div class="copyright">
  
  &copy; 
  <span itemprop="copyrightYear">2020</span>
  <span class="with-love">
    <i class="fa fa-heart"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">小龙人</span>
</div>

<!-- 用下面的符号注释，注释代码用下面括号括起来 -->
<!--
  <div class="powered-by">由 <a href="https://hexo.io/" class="theme-link" rel="noopener" target="_blank">Hexo</a> & <a href="https://theme-next.org/" class="theme-link" rel="noopener" target="_blank">NexT.Gemini</a> 强力驱动
  </div>

-->

        








      </div>
    </footer>
  </div>

  
  <script src="/blog/lib/anime.min.js"></script>
  <script src="/blog/lib/velocity/velocity.min.js"></script>
  <script src="/blog/lib/velocity/velocity.ui.min.js"></script>

<script src="/blog/js/utils.js"></script>

<script src="/blog/js/motion.js"></script>


<script src="/blog/js/schemes/pisces.js"></script>


<script src="/blog/js/next-boot.js"></script>




  















  

  

</body>
</html>

<!-- 页面点击小红心 -->
<script type="text/javascript" src="/js/src/clicklove.js"></script>
